Coding of transform coefficients for video coding

ABSTRACT

This disclosure describes techniques for coding transform coefficients associated with a block of residual video data in a video coding process. Aspects of this disclosure include the selection of a scan order for both significance map coding and level coding, as well as the selection of contexts for entropy coding consistent with the selected scan order. This disclosure proposes a harmonization of the scan order to code both the significance map of the transform coefficients as well as to code the levels of the transform coefficient. It is proposed that the scan order for the significance map should be in the inverse direction (i.e., from the higher frequencies to the lower frequencies). This disclosure also proposes that transform coefficients be scanned in sub-sets as opposed to fixed sub-blocks. In particular, transform coefficients are scanned in a sub-set consisting of a number of consecutive coefficients according to the scan order.

This application claims the benefit of U.S. Provisional Application No.61/450,555, filed Mar. 8, 2011, U.S. Provisional Application No.61/451,485, filed Mar. 10, 2011, U.S. Provisional Application No.61/451,496, filed Mar. 10, 2011, U.S. Provisional Application No.61/452,384, filed Mar. 14, 2011, U.S. Provisional Application No.61/494,855, filed Jun. 8, 2011 and U.S. Provisional Application No.61/497,345, filed Jun. 15, 2011, each of which is hereby incorporated byreference in its entirety.

TECHNICAL FIELD

This disclosure relates to video coding, and more particularly totechniques for scanning and coding transform coefficients generated byvideo coding processes.

BACKGROUND

Digital video capabilities can be incorporated into a wide range ofdevices, including digital televisions, digital direct broadcastsystems, wireless broadcast systems, personal digital assistants (PDAs),laptop or desktop computers, digital cameras, digital recording devices,digital media players, video gaming devices, video game consoles,cellular or satellite radio telephones, video teleconferencing devices,and the like. Digital video devices implement video compressiontechniques, such as those described in the standards defined by MPEG-2,MPEG-4, ITU-T H.263, ITU-T H.264/MPEG-4, Part 10, Advanced Video Coding(AVC), the High Efficiency Video Coding (HEVC) standard presently underdevelopment, and extensions of such standards, to transmit, receive andstore digital video information more efficiently.

Video compression techniques include spatial prediction and/or temporalprediction to reduce or remove redundancy inherent in video sequences.For block-based video coding, a video frame or slice may be partitionedinto blocks. Each block can be further partitioned. Blocks in anintra-coded (I) frame or slice are encoded using spatial prediction withrespect to reference samples in neighboring blocks in the same frame orslice. Blocks in an inter-coded (P or B) frame or slice may use spatialprediction with respect to reference samples in neighboring blocks inthe same frame or slice or temporal prediction with respect to referencesamples in other reference frames. Spatial or temporal predictionresults in a predictive block for a block to be coded. Residual datarepresents pixel differences between the original block to be coded andthe predictive block.

An inter-coded block is encoded according to a motion vector that pointsto a block of reference samples forming the predictive block, and theresidual data indicating the difference between the coded block and thepredictive block. An intra-coded block is encoded according to anintra-coding mode and the residual data. For further compression, theresidual data may be transformed from the pixel domain to a transformdomain, resulting in residual transform coefficients, which then may bequantized. The quantized transform coefficients, initially arranged in atwo-dimensional array, may be scanned in a particular order to produce aone-dimensional vector of transform coefficients for entropy coding.

SUMMARY

In general, this disclosure describes devices and methods for codingtransform coefficients associated with a block of residual video data ina video coding process. The techniques, structures and methods describedin this disclosure are applicable for video coding processes that useentropy coding (e.g., context adaptive binary arithmetic coding (CABAC))to code the transform coefficients. Aspects of this disclosure includethe selection of a scan order for both significance map coding and leveland sign coding, as well as the selection of contexts for entropy codingconsistent with the selected scan order. The techniques, structures andmethods of this disclosure are applicable for use in both a videoencoder and a video decoder.

This disclosure proposes a harmonization of the scan order to code boththe significance map of the transform coefficients as well as to codethe levels of the transform coefficient. That is to say, in someexamples, the scan order for the significance map and the level codingshould have the same pattern and direction. In another example, it isproposed that the scan order for the significance map should be in theinverse direction (i.e., from the coefficients for higher frequencies tothe coefficients for lower frequencies). In yet another example, it isproposed that the scan order for the significance map and the levelcoding should be harmonized such that each proceeds in an inversedirection.

This disclosure also proposes that, in some examples, the transformcoefficients be scanned in sub-sets. In particular, transformcoefficients are scanned in a sub-set consisting of a number ofconsecutive coefficients according to the scan order. Such sub-sets maybe applicable for both the significance map scan as well as thecoefficient level scan.

Additionally, this disclosure proposes that, in some examples, thesignificance map and the coefficient level scan are performed inconsecutive scans and according to the same scan order. In one aspect,the scan order is an inverse scan order. The consecutive scans mayconsist of several scan passes. Each scan pass may consist of a syntaxelement scan pass. For example, a first scan is the significance mapscan (also called bin 0 of the level of transform coefficients), asecond scan is of bin one of the levels of transform coefficients ineach sub-set, a third scan may be of bin two of the levels of transformcoefficients in each sub-set, a fourth scan is of the remaining bins ofthe levels of transform coefficients, and a fifth scan is of the sign ofthe levels of transform coefficients. The sign pass may be at any pointafter the significance map pass. Additionally, the number of scan passescan be reduced by coding more than one syntax element per pass. Forexample, one scan pass for the syntax elements using coded bins and asecond scan pass for the syntax elements using bypass bins (e.g., theremaining levels and the sign). In this context, a bin is part of thebin string that is entropy coded. A given a non-binary valued syntaxelement is mapped to a binary sequence (the so-called bin string).

This disclosure also proposes that, in some examples, the transformcoefficients are entropy coded using CABAC in two different contextregions. The context derivation for a first context region depends onthe position of the transform coefficients while the context derivationfor the second region depends on causal neighbors of the transformcoefficients. In another example, the second context region can use twodifferent context models depending on the location of the transformcoefficients.

In one example of the disclosure, a method of coding a plurality oftransform coefficients associated with residual video data in a videocoding process is proposed. The method comprises coding informationindicating significant coefficients for the plurality of transformcoefficients according to a scan order, and coding informationindicating levels of the plurality transform coefficients according tothe scan order.

In another example of the disclosure, a system configured to code aplurality of transform coefficients associated with residual video datain a video coding process is proposed. The system comprises a videocoding unit configured to code information indicating significantcoefficients for the plurality of transform coefficients according to ascan order, and further configured to code information indicating levelsof the significant coefficients for the plurality transform coefficientsaccording to the scan order.

In another example of the disclosure, a system for coding a plurality oftransform coefficients associated with residual video data in a videocoding process is proposed. The system comprises means for codinginformation indicating significant coefficients for the plurality oftransform coefficients according to a scan order, and means for codinginformation indicating levels of the significant coefficients for theplurality transform coefficients according to the scan order.

In another example of the disclosure, a computer program productcomprises a computer-readable storage medium having stored thereoninstructions that, when executed, cause a processor of a device forcoding a plurality of transform coefficients associated with residualvideo data in a video coding process to code information indicatingsignificant coefficients for the plurality of transform coefficientsaccording to a scan order, and code information indicating levels of thesignificant coefficients for the plurality transform coefficientsaccording to the scan order.

The details of one or more examples are set forth in the accompanyingdrawings and the description below. Other features, objects, andadvantages will be apparent from the description and drawings, and fromthe claims.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a conceptual diagram illustrating a significance map codingprocess.

FIG. 2 is a conceptual diagram illustrating scanning patterns anddirections for significance map coding.

FIG. 3 is a conceptual diagram illustrating a scanning technique forlevel coding of a transform unit.

FIG. 4 is a block diagram illustrating an example video coding system.

FIG. 5 is a block diagram illustrating an example video encoder.

FIG. 6 is a conceptual diagram illustrating inverse scan orders forsignificance map and coefficient level coding.

FIG. 7 is a conceptual diagram illustrating a first sub-set of transformcoefficients according to an inverse diagonal scan order.

FIG. 8 is a conceptual diagram illustrating a first sub-set of transformcoefficients according to an inverse horizontal scan order.

FIG. 9 is a conceptual diagram illustrating a first sub-set of transformcoefficients according to an inverse vertical scan order.

FIG. 10 is a conceptual diagram illustrating context regions forsignificance map coding.

FIG. 11 is a conceptual diagram illustrating example context regions forsignificance map coding using an inverse scan order.

FIG. 12 is a conceptual diagram illustrating example causal neighborsfor entropy coding using a forward scan order.

FIG. 13 is a conceptual diagram illustrating example causal neighborsfor entropy coding using an inverse scan order.

FIG. 14 is a conceptual diagram illustrating example context regions forentropy coding using an inverse scan order.

FIG. 15 is a conceptual diagram illustrating example causal neighborsfor entropy coding using an inverse scan order.

FIG. 16 is a conceptual diagram illustrating another example of contextregions for CABAC using an inverse scan order.

FIG. 17 is a conceptual diagram illustrating another example of contextregions for CABAC using an inverse scan order.

FIG. 18 is a conceptual diagram illustrating another example of contextregions for CABAC using an inverse scan order.

FIG. 19 is a block diagram illustrating an example entropy coding unit.

FIG. 20 is a block diagram illustrating an example video decoder.

FIG. 21 is a block diagram illustrating an example entropy decodingunit.

FIG. 22 is a flowchart illustrating an example process for significancemap and coefficients level scanning with a harmonized scan order.

FIG. 23 is a flowchart illustrating an example process for significancemap and coefficients level scanning and entropy coding contextderivation.

FIG. 24 is a flowchart illustrating another example process forsignificance map and coefficients level scanning and entropy codingcontext derivation.

FIG. 25 is a flowchart illustrating another example process forsignificance map and coefficients level scanning and entropy codingcontext derivation.

FIG. 26 is a flowchart illustrating an example process for significancemap coding using an inverse scan direction.

FIG. 27 is a flowchart illustrating an example process for significancemap and coefficient level scanning according to sub-sets of transformcoefficients.

FIG. 28 is a flowchart illustrating another example process forsignificance map and coefficient level scanning according to sub-sets oftransform coefficients.

FIG. 29 is a flowchart illustrating another example process forsignificance map and coefficient level scanning according to sub-sets oftransform coefficients.

FIG. 30 is a flowchart illustrating an example process for entropycoding using multiple regions.

DETAILED DESCRIPTION

Digital video devices implement video compression techniques to transmitand receive digital video information more efficiently. Videocompression may apply spatial (intra-frame) prediction and/or temporal(inter-frame) prediction techniques to reduce or remove redundancyinherent in video sequences.

For video coding according to the high efficiency video coding (HEVC)standard currently under development by the Joint Cooperative Team forVideo Coding (JCT-VC), as one example, a video frame may be partitionedinto coding units. A coding unit generally refers to an image regionthat serves as a basic unit to which various coding tools are appliedfor video compression. A coding unit is typically square (though notnecessarily), and may be considered to be similar to a so-calledmacroblock, e.g., under other video coding standards such as ITU-TH.264. Coding according to some of the presently proposed aspects of thedeveloping HEVC standard will be described in this application forpurposes of illustration. However, the techniques described in thisdisclosure may be useful for other video coding processes, such as thosedefined according to H.264 or other standard or proprietary video codingprocesses.

To achieve desirable coding efficiency, a coding unit (CU) may havevariable sizes depending on video content. In addition, a coding unitmay be split into smaller blocks for prediction or transform. Inparticular, each coding unit may be further partitioned into predictionunits (PUs) and transform units (TUs). Prediction units may beconsidered to be similar to so-called partitions under other videocoding standards, such as the H.264 standard. A transform unit (TU)generally refers to a block of residual data to which a transform isapplied to produce transform coefficients.

A coding unit usually has a luminance component, denoted as Y, and twochroma components, denoted as U and V. Depending on the video samplingformat, the size of the U and V components, in terms of number ofsamples, may be the same as or different from the size of the Ycomponent.

To code a block (e.g., a prediction unit of video data), a predictor forthe block is first derived. The predictor, also referred to as apredictive block, can be derived either through intra (I) prediction(i.e., spatial prediction) or inter (P or B) prediction (i.e. temporalprediction). Hence, some prediction units may be intra-coded (I) usingspatial prediction with respect to reference samples in neighboringreference blocks in the same frame (or slice), and other predictionunits may be uni-directionally inter-coded (P) or bi-directionallyinter-coded (B) with respect to blocks of reference samples in otherpreviously-coded frames (or slices). In each case, the reference samplesmay be used to form a predictive block for a block to be coded.

Upon identification of a predictive block, the difference between theoriginal video data block and its predictive block is determined. Thisdifference may be referred to as the prediction residual data, andindicates the pixel differences between the pixel values in the block tothe coded and the pixel values in the predictive block selected torepresent the coded block. To achieve better compression, the predictionresidual data may be transformed, e.g., using a discrete cosinetransform (DCT), an integer transform, a Karhunen-Loeve (K-L) transform,or another transform.

The residual data in a transform block, such as a TU, may be arranged ina two-dimensional (2D) array of pixel difference values residing in thespatial, pixel domain. A transform converts the residual pixel valuesinto a two-dimensional array of transform coefficients in a transformdomain, such as a frequency domain. For further compression, thetransform coefficients may be quantized prior to entropy coding. Anentropy coder then applies entropy coding, such as Context AdaptiveVariable Length Coding (CAVLC), Context Adaptive Binary ArithmeticCoding (CABAC), Probability Interval Partitioning Entropy Coding (PIPE),or the like, to the quantized transform coefficients.

To entropy code a block of quantized transform coefficients, a scanningprocess is usually performed so that the two-dimensional (2D) array ofquantized transform coefficients in a block is processed, according to aparticular scan order, in an ordered, one-dimensional (1D) array, i.e.,vector, of transform coefficients. Entropy coding is applied in the 1-Dorder of transform coefficients. The scan of the quantized transformcoefficients in a transform unit serializes the 2D array of transformcoefficients for the entropy coder. A significance map may be generatedto indicate the positions of significant (i.e., non-zero) coefficients.Scanning may be applied to scan levels of significant (i.e., nonzero)coefficients, and/or to code signs of the significant coefficients.

For a DCT, as an example, there is often a higher probability ofnon-zero coefficients toward an upper left corner (i.e., a low frequencyregion) of the 2D transform unit. It may be desirable to scan thecoefficients in a way that increases the probability of groupingnon-zero coefficients together at one end of the serialized run ofcoefficients, permitting zero-valued coefficients to be grouped togethertoward another end of the serialized vector and more efficiently codedas runs of zeros. For this reason, scan order may be important forefficient entropy coding.

As one example, the so-called diagonal (or wavefront) scan order hasbeen adopted for use in scanning quantized transform coefficients in theHEVC standard. Alternatively, zig-zag, horizontal, vertical or otherscan orders may be used. Through transform and quantization, asmentioned above, non-zero transform coefficients are generally locatedat the low frequency area toward the upper left region of the block foran example in which the transform is a DCT. As a result, after thediagonal scanning process, which may traverse the upper left regionfirst, non-zero transform coefficients are usually more likely to belocated in the front portion of the scan. For a diagonal scanningprocess that traverses from the lower right region first, the non-zerotransform coefficients are usually more likely to be located in the backportion of the scan.

A number of zero coefficients will typically be grouped at one end ofthe scan, depending on the scan direction, due to reduced energy athigher frequencies, and due to the effects of quantization, which maycause some nonzero coefficients to become zero-valued coefficients uponreduction of bit depth. These characteristics of coefficientdistribution in the serialized 1D array may be utilized in entropy coderdesign to improve coding efficiency. In other words, if non-zerocoefficients can be effectively arranged in one portion of the 1D arraythrough some appropriate scan order, better coding efficiency can beexpected due to the design of many entropy coders.

To achieve this objective of placing more non-zero coefficients at oneend of the 1D array, different scan orders may be used in a videoencoder-decoder (CODEC) to code transform coefficients. In some cases,diagonal scanning may be effective. In other cases, different types ofscanning, such as zig-zag, vertical or horizontal scanning may be moreeffective.

Different scan orders may be produced in a variety of ways. One exampleis that, for each block of transform coefficients, a “best” scan ordermay be chosen from a number of available scan orders. A video encoderthen may provide an indication to the decoder, for each block, of anindex of the best scan order among a set of scan orders denoted byrespective indices. The selection of the best scan order may bedetermined by applying several scan orders and selecting one that ismost effective in placing nonzero coefficients near the beginning or endof the 1D vector, thereby promoting efficient entropy coding.

In another example, the scan order for a current block may be determinedbased on various factors relating to the coding of the pertinentprediction unit, such as the prediction mode (I, B, P), block size,transform or other factors. In some cases, because the same information,e.g., prediction mode, can be inferred at both the encoder and decoderside, there may be no need to provide an indication of the scan orderindex to the decoder. Instead, the video decoder may store configurationdata that indicates the appropriate scan order given knowledge of theprediction mode for a block, and one or more criteria that maps aprediction mode to a particular scan order.

To further improve coding efficiency, the available scan orders may notbe constant all of the time. Instead, some adaptation might be enabledso that the scan order is adaptively adjusted, e.g., based oncoefficients that are already coded. In general, the scan orderadaptation may be done in such a way that, according to the selectedscan order, zero and non-zero coefficients are more likely to be groupedtogether.

In some video CODECs, the initial available scan orders may be in a veryregular form such as purely horizontal, vertical, diagonal, or zig-zagscan. Alternatively, the scan orders may be derived through a trainingprocess and therefore may appear to be somewhat random. The trainingprocess may involve application of different scan orders to a block orseries of blocks to identify a scan order that produces desirableresults, e.g., in terms of efficient placement of nonzero andzero-valued coefficients, as mentioned above.

If a scan order is derived from a training process, or if a variety ofdifferent scan orders can be selected, it may be beneficial to save theparticular scan orders at both the encoder and decoder side. The amountof data specifying such scan orders can be substantial. For example, fora 32×32 transform block, one scan order may contain 1024 transformcoefficient positions. Because there may be differently sized blocksand, for each size of transform block, there may be a number ofdifferent scan orders, the total amount of data that needs to be savedis not negligible. Regular scan orders such as diagonal, horizontal,vertical or zig-zag order may not require storage, or may requireminimal storage. However, diagonal, horizontal, vertical or zig-zagorders may not provide sufficient variety to provide coding performancethat is on par with trained scan orders.

In one conventional example, for H.264 and the HEVC standard presentlyunder development, when the CABAC entropy coder is used, the positionsof the significant coefficients (i.e., nonzero transform coefficients)in the transform block (i.e., transform unit in HEVC) are encoded priorto the levels of the coefficients. The process of coding the locationsof the significant coefficients is called significance map coding. Thesignificance of a coefficient is the same as the bin zero of thecoefficient level. As shown in FIG. 1, significance map coding of thequantized transform coefficients 11 produces a significance map 13. Thesignificance map 13 is a map of ones and zeros, where the ones indicatelocations of significant coefficients. The significance map typicallyrequires a high percentage of the video bit-rate. The techniques of thisdisclosure may also be applicable for use with other entropy coders(e.g., PIPE).

An example process for coding a significance map is described in D.Marpe, H. Schwarz, and T. Wiegand “Context-Based Adaptive BinaryArithmetic Coding in the H.264/AVC Video Compression Standard,” IEEETrans. Circuits and Systems for Video Technology, vol. 13, no. 7, July2003. In this process, the significance map is coded if there is atleast one significant coefficient in the block, as indicated by theCoded Block Flag (CBF), which is defined as:

-   -   Coded Block Flag: coded_block_flag is a one-bit symbol, which        indicates if there are significant, i.e., nonzero coefficients        inside a single block of transform coefficients, for which the        coded block pattern indicates nonzero entries. If        coded_block_flag is zero, no further information is transmitted        for the related block.

If there are significant coefficients in the block, the significance mapis encoded by following a scan order of transform coefficients in theblock as follows:

-   -   Scanning of Transform Coefficients: two-dimensional arrays of        transform coefficient levels of sub-blocks for which the        coded_block_flag indicates nonzero entries are first mapped into        a one-dimensional list using a given scanning pattern. In other        words, sub-blocks with significant coefficients are scanned        according to a scanning pattern.

Given the scanning pattern, the significance map is scanned as follows:

-   -   Significance Map: If the coded_block_flag indicates that a block        has significant coefficients, a binary-valued significance map        is encoded. For each transform coefficient in the scanning        order, a one-bit symbol significant_coeff_flag is transmitted.        If the significant_coeff_flag symbol is one, i.e., if a nonzero        coefficient exists at this scanning position, a further one-bit        symbol last_significant_coeff_flag is sent. This symbol        indicates if the current significant coefficient is the last one        inside the block or if further significant coefficients follow.        If the last scanning position is reached and the significance        map encoding was not already terminated by a        last_significant_coeff_flag with value one, it is apparent that        the last coefficient has to be significant.

Recent proposals for HEVC have removed the last_significant_coeff_flag.In those proposals, before sending the significance map, an indicationof the X and Y position of the position of the last significantcoefficient is sent.

Currently, in HEVC, it is proposed that three scan patterns be used forthe significance map: diagonal, vertical, and horizontal. FIG. 2 showsan example of a zig-zag scan 17, a vertical scan 19, a horizontal scan21, and a diagonal scan 15. As shown in FIG. 2, each of these scansproceeds in a forward direction, i.e., from lower frequency transformcoefficients in the upper left corner of the transform block to thehigher frequency transform coefficients in the lower right corner of thetransform block. After the significance map is coded, the remaininglevel information (bins 1-N, where N is the total number of bins) foreach significant transform coefficient (i.e., the coefficient value) iscoded.

In the CABAC process previously specified in the H.264 standard,following the handling of 4×4 sub-blocks, each of the transformcoefficient levels is binarized, e.g., according to a unary code, toproduce a series of bins. In H.264, the CABAC context model set for eachsub-block consists of two times five context models with five models forboth the first bin and all remaining bins (up to and including the14^(th) bin) of the coeff_abs_level_minus one syntax element, whichencodes the absolute value of a transform coefficient. Notably, in oneproposed version of HEVC, the remaining bins include only bin 1 and bin2. The remainder of the coefficient levels are coded with Golomb-Ricecoding and exponential Golomb codes.

In HEVC, the selection of context models may be performed as in theoriginal CABAC process proposed for the H.264 standard. However,different sets of context models may be selected for differentsub-blocks. In particular, the choice of the context model set for agiven sub-block depends on certain statistics of the previously codedsub-blocks.

FIG. 3 shows the scanning order followed by one proposed version of theHEVC process to encode the levels of transform coefficients (absolutevalue of the level and sign of the level) in a transform unit 25. Notethat there is a forward zig-zag pattern 27 for scanning of the 4×4sub-blocks of a larger block, and an inverse zig-zag pattern 23 forscanning the levels of transform coefficients within each sub-block. Inother words, a series of 4×4 sub-blocks are scanned in a forward zig-zagpattern such that the sub-blocks are scanned in a sequence. Then, withineach sub-block, an inverse zig-zag scan is performed to scan the levelsof the transform coefficients within the sub-block. Hence, the transformcoefficients in the two-dimensional array formed by the transform unitare serialized into a one-dimensional array such that coefficients thatare inverse scanned in a given sub-block are then followed bycoefficients that are inverse scanned in a successive sub-block.

In one example, the CABAC coding of coefficients scanned according tothe sub-block scan approach shown in FIG. 3 may use 60 contexts, i.e., 6sets of 10 contexts each, distributed as described below. For a 4×4block, 10 context models might be used (5 models for bin 1 and 5 modelsfor bins 2 to 14), as shown in Table 1:

TABLE 1 Contexts for bin 1 and bins 2 to 14 of the coefficient levels ofa sub- block Model bin 2-14 (remaining Model bin 1 bins) 0 Encodedcoefficient 0 Initial or 0 coefficients larger than 1 larger than one 1Initial - no trailing ones 1 1 coefficient larger than one in sub-block2 2 coefficients larger than 2 1 trailing one in sub- one block 3 3coefficients larger than 3 2 trailing ones in sub- one block 4 4 or morecoefficient larger 4 3 or more trailing ones in than one sub-block

Per Table 1, one of context models 0-4 in the context set is used forbin 1 if, respectively, the currently encoded coefficient that is beingscanned in the sub-block is encoded after a coefficient larger than 1has been encoded within the sub-block, the currently encoded coefficientis the initial coefficient scanned in the sub-block or there are notrailing ones (no previously encoded coefficients) in the sub-block,there is one trailing one in the sub-block (i.e., a one has been encodedbut no coefficients larger than one have been encoded), there are twotrailing ones in the sub-block, or there are three or more trailing onesin the sub-block. For each of bins 2-14 (although the currently proposedversion of HEVC codes only bin 2 using CABAC, with successive bins ofthe coefficient level being coded with an exponential Golomb code), oneof context models 0-4 may be used, respectively, if the coefficient isthe initial coefficient scanned in the sub-block or there are zeropreviously coded coefficients larger than one, there is one previouslycoded coefficient larger than one, there are two previously codedcoefficients larger than one, there are three previously codedcoefficients larger than one, or there are four previously codedcoefficients larger than one.

There are 6 different sets of these 10 models, depending on the numberof coefficients larger than 1 in the previous coded 4×4 sub-block in theforward scan of sub-blocks:

TABLE 2 Contexts for bin 1 and bins 2 to 14 Context Set 0 For block size4 × 4 only 1 0-3 Coefficients Larger than 1 in previous sub-block 2 4-7LargerT1 in previous sub- block 3 8-11 LargerT1 in previous sub- block 412-15 LargerT1 in previous sub- block 5 First 4 × 4 sub-block 16LargerT1 in previous sub-block

Per Table 2, sets 0-5 of context models are used for a given sub-blockif, respectively, the sub-block size is 4×4, there are 0 to 3coefficients larger than 1 in the previously coded sub-block, there are4 to 7 coefficients larger than 1 in the previously coded sub-block,there are 8-11 coefficients larger than 1 in the previously codedsub-block, there are 12 to 15 coefficients larger than 1 in thepreviously coded sub-block, or the given sub-block is the first 4×4sub-block (top left sub-block) or there are 16 coefficients larger than1 in the previously coded sub-block.

The above-described coding process for H.264 and that currently proposedfor HEVC has several drawbacks. As shown in FIG. 3, one drawback is thatthe scan for coefficient levels proceeds forward for the scan ofsub-blocks (i.e., starting with the upper left sub-block) but thenbackward for the scan of the coefficient levels within each sub-block(i.e., starting with the lower right coefficient in each sub-block).This approach implies going back and forth within the block, which maymake data fetching more complex.

Another drawback comes from the fact that the scan order of thecoefficient level is different from the scan order of the significancemap. In HEVC, there are three different proposed scan orders for thesignificance map: forward diagonal, forward horizontal and forwardvertical as shown in FIG. 2. All of the significant coefficient scansare different from the scan of coefficient levels currently proposed forHEVC, since the level scans proceed in an inverse direction. Because thedirection and pattern of the coefficient level scan is not matched withthe direction and pattern of the significance scan, more coefficientlevels have to be checked. For instance, assume that a horizontal scanis used for the significance map, and the last significant coefficientis found at the end of the first row of coefficients. The coefficientlevel scan in HEVC would require a diagonal scan across multiple rowsfor the level scan, when only the first row actually containscoefficient levels different from 0. Such a scanning process mayintroduce unwanted inefficiencies.

In the current proposal for HEVC, the scan of the significance mapproceeds forward in the block, from the DC coefficient found in theupper left corner of the block to the highest frequency coefficienttypically found in the lower right corner of the block, while the scanfor the coefficient levels is backward within each 4×4 sub-block. Thistoo may result in more complex and more inefficient data fetching.

Another drawback to current HEVC proposals comes from the context sets.The context set (see Tables 2 above) for CABAC is different for blocksize 4×4 than for other block sizes. In accordance with this disclosure,it would be desirable to harmonize contexts across all block sizes sothat less memory is dedicated to storing different context sets.

Also, as will be described in more detail below, the currently proposedCABAC contexts for the significance map for HEVC are only valid if thescan order is forward. As such, this would not allow for inversesignificance map scans.

Furthermore, the contexts described above for encoding the level of aquantized coefficient attempt to exploit the local correlation ofcoefficient levels. These contexts depend on the correlation among 4×4sub-blocks (see the contexts set in Table 2), and the correlation withineach sub-block (see context models in Table 1). The drawback of thesecontexts is that the dependency might be too far (i.e., there is lowdependency between coefficients which are separated from one another byseveral other coefficients, from one sub-block to another). Also, withineach sub-block, the dependency might be weak.

This disclosure proposes several different features that may reduce oreliminate some of the drawbacks described above. In some examples, thesefeatures may provide a more efficient and harmonized scan order of thetransform coefficients in video coding. In other examples of thisdisclosure, these features provide a more efficient set of contexts tobe used in CABAC-based entropy coding of the transform coefficientsconsistent with the proposed scan order. It should be noted that all ofthe techniques described in this disclosure may be used independently ormay be used together in any combination.

FIG. 4 is a block diagram illustrating an example video encoding anddecoding system 10 that may be configured to utilize techniques forcoding transform coefficients in accordance with examples of thisdisclosure. As shown in FIG. 4, the system 10 includes a source device12 that transmits encoded video to a destination device 14 via acommunication channel 16. Encoded video may also be stored on a storagemedium 34 or a file server 36 and may be accessed by the destinationdevice 14 as desired. The source device 12 and the destination device 14may comprise any of a wide variety of devices, including desktopcomputers, notebook (i.e., laptop) computers, tablet computers, set-topboxes, telephone handsets such as so-called smartphones, televisions,cameras, display devices, digital media players, video gaming consoles,or the like. In many cases, such devices may be equipped for wirelesscommunication. Hence, the communication channel 16 may comprise awireless channel, a wired channel, or a combination of wireless andwired channels suitable for transmission of encoded video data.Similarly, the file server 36 may be accessed by the destination device14 through any standard data connection, including an Internetconnection. This may include a wireless channel (e.g., a Wi-Ficonnection), a wired connection (e.g., DSL, cable modem, etc.), or acombination of both that is suitable for accessing encoded video datastored on a file server.

Techniques for coding transform coefficients, in accordance withexamples of this disclosure, may be applied to video coding in supportof any of a variety of multimedia applications, such as over-the-airtelevision broadcasts, cable television transmissions, satellitetelevision transmissions, streaming video transmissions, e.g., via theInternet, encoding of digital video for storage on a data storagemedium, decoding of digital video stored on a data storage medium, orother applications. In some examples, the system 10 may be configured tosupport one-way or two-way video transmission to support applicationssuch as video streaming, video playback, video broadcasting, and/orvideo telephony.

In the example of FIG. 4, the source device 12 includes a video source18, a video encoder 20, a modulator/demodulator 22 and a transmitter 24.In the source device 12, the video source 18 may include a source suchas a video capture device, such as a video camera, a video archivecontaining previously captured video, a video feed interface to receivevideo from a video content provider, and/or a computer graphics systemfor generating computer graphics data as the source video, or acombination of such sources. As one example, if the video source 18 is avideo camera, the source device 12 and the destination device 14 mayform so-called camera phones or video phones. However, the techniquesdescribed in this disclosure may be applicable to video coding ingeneral, and may be applied to wireless and/or wired applications.

The captured, pre-captured, or computer-generated video may be encodedby the video encoder 20. The encoded video information may be modulatedby the modem 22 according to a communication standard, such as awireless communication protocol, and transmitted to the destinationdevice 14 via the transmitter 24. The modem 22 may include variousmixers, filters, amplifiers or other components designed for signalmodulation. The transmitter 24 may include circuits designed fortransmitting data, including amplifiers, filters, and one or moreantennas.

The captured, pre-captured, or computer-generated video that is encodedby the video encoder 20 may also be stored onto a storage medium 34 or afile server 36 for later consumption. The storage medium 34 may includeBlu-ray discs, DVDs, CD-ROMs, flash memory, or any other suitabledigital storage media for storing encoded video. The encoded videostored on the storage medium 34 may then be accessed by the destinationdevice 14 for decoding and playback.

The file server 36 may be any type of server capable of storing encodedvideo and transmitting that encoded video to the destination device 14.Example file servers include a web server (e.g., for a website), an FTPserver, network attached storage (NAS) devices, a local disk drive, orany other type of device capable of storing encoded video data andtransmitting it to a destination device. The transmission of encodedvideo data from the file server 36 may be a streaming transmission, adownload transmission, or a combination of both. The file server 36 maybe accessed by the destination device 14 through any standard dataconnection, including an Internet connection. This may include awireless channel (e.g., a Wi-Fi connection), a wired connection (e.g.,DSL, cable modem, Ethernet, USB, etc.), or a combination of both that issuitable for accessing encoded video data stored on a file server.

The destination device 14, in the example of FIG. 4, includes a receiver26, a modem 28, a video decoder 30, and a display device 32. Thereceiver 26 of the destination device 14 receives information over thechannel 16, and the modem 28 demodulates the information to produce ademodulated bitstream for the video decoder 30. The informationcommunicated over the channel 16 may include a variety of syntaxinformation generated by the video encoder 20 for use by the videodecoder 30 in decoding video data. Such syntax may also be included withthe encoded video data stored on the storage medium 34 or the fileserver 36. Each of the video encoder 20 and the video decoder 30 mayform part of a respective encoder-decoder (CODEC) that is capable ofencoding or decoding video data.

The display device 32 may be integrated with, or external to, thedestination device 14. In some examples, the destination device 14 mayinclude an integrated display device and also be configured to interfacewith an external display device. In other examples, the destinationdevice 14 may be a display device. In general, the display device 32displays the decoded video data to a user, and may comprise any of avariety of display devices such as a liquid crystal display (LCD), aplasma display, an organic light emitting diode (OLED) display, oranother type of display device.

In the example of FIG. 4, the communication channel 16 may comprise anywireless or wired communication medium, such as a radio frequency (RF)spectrum or one or more physical transmission lines, or any combinationof wireless and wired media. The communication channel 16 may form partof a packet-based network, such as a local area network, a wide-areanetwork, or a global network such as the Internet. The communicationchannel 16 generally represents any suitable communication medium, orcollection of different communication media, for transmitting video datafrom the source device 12 to the destination device 14, including anysuitable combination of wired or wireless media. The communicationchannel 16 may include routers, switches, base stations, or any otherequipment that may be useful to facilitate communication from the sourcedevice 12 to the destination device 14.

The video encoder 20 and the video decoder 30 may operate according to avideo compression standard, such as the High Efficiency Video Coding(HEVC) standard presently under development, and may conform to the HEVCTest Model (HM). Alternatively, the video encoder 20 and the videodecoder 30 may operate according to other proprietary or industrystandards, such as the ITU-T H.264 standard, alternatively referred toas MPEG-4, Part 10, Advanced Video Coding (AVC), or extensions of suchstandards. The techniques of this disclosure, however, are not limitedto any particular coding standard. Other examples include MPEG-2 andITU-T H.263.

Although not shown in FIG. 4, in some aspects, the video encoder 20 andthe video decoder 30 may each be integrated with an audio encoder anddecoder, and may include appropriate MUX-DEMUX units, or other hardwareand software, to handle encoding of both audio and video in a commondata stream or separate data streams. If applicable, in some examples,MUX-DEMUX units may conform to the ITU H.223 multiplexer protocol, orother protocols such as the user datagram protocol (UDP).

The video encoder 20 and the video decoder 30 each may be implemented asany of a variety of suitable encoder circuitry, such as one or moremicroprocessors, digital signal processors (DSPs), application specificintegrated circuits (ASICs), field programmable gate arrays (FPGAs),discrete logic, software, hardware, firmware or any combinationsthereof. When the techniques are implemented partially in software, adevice may store instructions for the software in a suitable,non-transitory computer-readable medium and execute the instructions inhardware using one or more processors to perform the techniques of thisdisclosure. Each of the video encoder 20 and the video decoder 30 may beincluded in one or more encoders or decoders, either of which may beintegrated as part of a combined encoder/decoder (CODEC) in a respectivedevice.

The video encoder 20 may implement any or all of the techniques of thisdisclosure to improve encoding of transform coefficients in a videocoding process. Likewise, the video decoder 30 may implement any or allof these techniques to improve decoding of transform coefficients in avideo coding process. A video coder, as described in this disclosure,may refer to a video encoder or a video decoder. Similarly, a videocoding unit may refer to a video encoder or a video decoder. Likewise,video coding may refer to video encoding or video decoding.

In one example of the disclosure, a video coder (such as video encoder20 or video decoder 30) may be configured to code a plurality oftransform coefficients associated with residual video data in a videocoding process. The video coder may be configured to code informationindicating significant coefficients for the plurality of transformcoefficients according to a scan order, and code information indicatinglevels of the plurality transform coefficients according to the scanorder.

In another example of the disclosure, a video coder (such as videoencoder 20 or video decoder 30) may be configured to code a plurality oftransform coefficients associated with residual video data in a videocoding process. The video coder may be configured to code informationindicating the significant transform coefficients in a block oftransform coefficients with a scan proceeding in an inverse scandirection from higher frequency coefficients in the block of transformcoefficients to lower frequency coefficients in the block of transformcoefficients.

In another example of the disclosure, a video coder (such as videoencoder 20 or video decoder 30) may be configured to code a plurality oftransform coefficients associated with residual video data in a videocoding process. The video coder may be configured to arrange a block oftransform coefficients into one or more sub-sets of transformcoefficients based on a scan order, code a first portion of levels oftransform coefficients in each sub-set, wherein the first portion oflevels includes at least a significance of the transform coefficients ineach subset, and code a second portion of levels of transformcoefficients in each sub-set.

In another example of the disclosure, a video coder (such as videoencoder 20 or video decoder 30) may be configured to code informationindicating significant coefficients for the plurality of transformcoefficients according to a scan order, divide the coded informationinto at least a first region and a second region, entropy code the codedinformation in the first region according to a first set of contextsusing context derivation criteria, and entropy code the codedinformation in the second region according to a second set of contextsusing the same context derivation criteria as the first region.

FIG. 5 is a block diagram illustrating an example of a video encoder 20that may use techniques for coding transform coefficients as describedin this disclosure. The video encoder 20 will be described in thecontext of HEVC coding for purposes of illustration, but withoutlimitation of this disclosure as to other coding standards or methodsthat may require scanning of transform coefficients. The video encoder20 may perform intra- and inter-coding of CUs within video frames.Intra-coding relies on spatial prediction to reduce or remove spatialredundancy in video within a given video frame. Inter-coding relies ontemporal prediction to reduce or remove temporal redundancy between acurrent frame and previously coded frames of a video sequence.Intra-mode (I-mode) may refer to any of several spatial-based videocompression modes. Inter-modes such as uni-directional prediction(P-mode) or bi-directional prediction (B-mode) may refer to any ofseveral temporal-based video compression modes.

As shown in FIG. 5, the video encoder 20 receives a current video blockwithin a video frame to be encoded. In the example of FIG. 5, the videoencoder 20 includes a motion compensation unit 44, a motion estimationunit 42, an intra-prediction module 46, a reference frame buffer 64, asummer 50, a transform module 52, a quantization unit 54, and an entropyencoding unit 56. The transform module 52 illustrated in FIG. 5 is themodule that applies the actual transform to a block of residual data,and is not to be confused with block of transform coefficients, whichalso may be referred to as a transform unit (TU) of a CU. For videoblock reconstruction, the video encoder 20 also includes an inversequantization unit 58, an inverse transform module 60, and a summer 62. Adeblocking filter (not shown in FIG. 5) may also be included to filterblock boundaries to remove blockiness artifacts from reconstructedvideo. If desired, the deblocking filter would typically filter theoutput of the summer 62.

During the encoding process, the video encoder 20 receives a video frameor slice to be coded. The frame or slice may be divided into multiplevideo blocks, e.g., largest coding units (LCUs). The motion estimationunit 42 and the motion compensation unit 44 perform inter-predictivecoding of the received video block relative to one or more blocks in oneor more reference frames to provide temporal compression. Theintra-prediction module 46 may perform intra-predictive coding of thereceived video block relative to one or more neighboring blocks in thesame frame or slice as the block to be coded to provide spatialcompression.

The mode select unit 40 may select one of the coding modes, intra orinter, e.g., based on error (i.e., distortion) results for each mode,and provides the resulting intra- or inter-coded block to the summer 50to generate residual block data and to the summer 62 to reconstruct theencoded block for use in a reference frame. Some video frames may bedesignated as I-frames, where all blocks in an I-frame are encoded in anintra-prediction mode. In some cases, the intra-prediction module 46 mayperform intra-prediction encoding of a block in a P- or B-frame, e.g.,when motion search performed by the motion estimation unit 42 does notresult in a sufficient prediction of the block.

The motion estimation unit 42 and the motion compensation unit 44 may behighly integrated, but are illustrated separately for conceptualpurposes. Motion estimation is the process of generating motion vectors,which estimate motion for video blocks. A motion vector, for example,may indicate the displacement of a prediction unit in a current framerelative to a reference sample of a reference frame. A reference samplemay be a block that is found to closely match the portion of the CUincluding the PU being coded in terms of pixel difference, which may bedetermined by sum of absolute difference (SAD), sum of square difference(SSD), or other difference metrics. Motion compensation, performed bythe motion compensation unit 44, may involve fetching or generatingvalues for the prediction unit based on the motion vector determined bymotion estimation. Again, the motion estimation unit 42 and the motioncompensation unit 44 may be functionally integrated, in some examples.

The motion estimation unit 42 calculates a motion vector for aprediction unit of an inter-coded frame by comparing the prediction unitto reference samples of a reference frame stored in the reference framebuffer 64. In some examples, the video encoder 20 may calculate valuesfor sub-integer pixel positions of reference frames stored in thereference frame buffer 64. For example, the video encoder 20 maycalculate values of one-quarter pixel positions, one-eighth pixelpositions, or other fractional pixel positions of the reference frame.Therefore, the motion estimation unit 42 may perform a motion searchrelative to the full pixel positions and fractional pixel positions andoutput a motion vector with fractional pixel precision. The motionestimation unit 42 sends the calculated motion vector to the entropyencoding unit 56 and the motion compensation unit 44. The portion of thereference frame identified by a motion vector may be referred to as areference sample. The motion compensation unit 44 may calculate aprediction value for a prediction unit of a current CU, e.g., byretrieving the reference sample identified by a motion vector for thePU.

The intra-prediction module 46 may intra-prediction encode the receivedblock, as an alternative to inter-prediction performed by the motionestimation unit 42 and the motion compensation unit 44. Theintra-prediction module 46 may encode the received block relative toneighboring, previously coded blocks, e.g., blocks above, above and tothe right, above and to the left, or to the left of the current block,assuming a left-to-right, top-to-bottom encoding order for blocks. Theintra-prediction module 46 may be configured with a variety of differentintra-prediction modes. For example, the intra-prediction module 46 maybe configured with a certain number of directional prediction modes,e.g., 33 directional prediction modes, based on the size of the CU beingencoded.

The intra-prediction module 46 may select an intra-prediction mode by,for example, calculating error values for various intra-prediction modesand selecting a mode that yields the lowest error value. Directionalprediction modes may include functions for combining values of spatiallyneighboring pixels and applying the combined values to one or more pixelpositions in a PU. Once values for all pixel positions in the PU havebeen calculated, the intra-prediction module 46 may calculate an errorvalue for the prediction mode based on pixel differences between the PUand the received block to be encoded. The intra-prediction module 46 maycontinue testing intra-prediction modes until an intra-prediction modethat yields an acceptable error value is discovered. Theintra-prediction module 46 may then send the PU to the summer 50.

The video encoder 20 forms a residual block by subtracting theprediction data calculated by the motion compensation unit 44 or theintra-prediction module 46 from the original video block being coded.The summer 50 represents the component or components that perform thissubtraction operation. The residual block may correspond to atwo-dimensional matrix of pixel difference values, where the number ofvalues in the residual block is the same as the number of pixels in thePU corresponding to the residual block. The values in the residual blockmay correspond to the differences, i.e., error, between values ofco-located pixels in the PU and in the original block to be coded. Thedifferences may be chroma or luma differences depending on the type ofblock that is coded.

The transform module 52 may form one or more transform units (TUs) fromthe residual block. The transform module 52 applies a transform, such asa discrete cosine transform (DCT), a directional transform, or aconceptually similar transform, to the TU, producing a video blockcomprising transform coefficients. The transform module 52 may send theresulting transform coefficients to the quantization unit 54. Thequantization unit 54 may then quantize the transform coefficients. Theentropy encoding unit 56 may then perform a scan of the quantizedtransform coefficients in the matrix according to a specified scanorder. This disclosure describes the entropy encoding unit 56 asperforming the scan. However, it should be understood that, in otherexamples, other processing units, such as the quantization unit 54,could perform the scan.

As mentioned above, scanning of the transform coefficients may involvetwo scans. One scan identifies which of the coefficients are significant(i.e., nonzero) to form the significance map and another scan codes thelevels of the transform coefficients. In one example, this disclosureproposes that the scan order used to code coefficient levels in a blockbe the same as the scan order used to code significant coefficients inthe significance map for the block. In HEVC, the block may be atransform unit. As used herein, the term scan order may refer to eitherthe direction of the scan and/or the pattern of the scan. As such, thescans for the significance map and the coefficient levels may be thesame in scan pattern and/or scan direction. That is, as one example, ifthe scan order used to form the significance map is a horizontal scanpattern in the forward direction, then the scan order for coefficientlevels should also be a horizontal scan pattern in the forwarddirection. Likewise, as another example, if the scan order for thesignificance map is a vertical scan pattern in the inverse direction,then the scan order for coefficient levels should also be a verticalscan pattern in the inverse direction. The same may apply for diagonal,zig-zag or other scan patterns.

FIG. 6 shows examples of inverse scan orders for a block of transformcoefficients, i.e., a transform block. The transform block may be formedusing a transform such as, for example, a discrete cosine transform(DCT). Note that each of the inverse diagonal pattern 9, inverse zig-zagpattern 29, the inverse vertical pattern 31, and the inverse horizontalpattern 33 proceed from the higher frequency coefficients in the lowerright corner of the transform block to lower frequency coefficients inthe upper left corner of the transform block. Hence, one aspect of thedisclosure presents a unified scan order for coding of the significancemap and coding of coefficient levels. The proposed technique applies thescan order used for the significance map to the scan order used forcoefficient level coding. In general, horizontal, vertical and diagonalscan patterns have been shown to work well, thus reducing the need foradditional scan patterns. However, the general techniques of thisdisclosure are applicable for use with any scan pattern.

According to another aspect, this disclosure proposes that thesignificance scan be performed as an inverse scan, from the lastsignificant coefficient in the transform unit to the first coefficient(i.e., the DC coefficient) in the transform unit. Examples of inversescan orders are shown in FIG. 6. In particular, the significance scanproceeds from the last significant coefficient at a higher frequencyposition to significant coefficients at lower frequency positions, andultimately to the DC coefficient position.

To facilitate the inverse scan, techniques for identifying the lastsignificant coefficient may be used. A process for identifying the lastsignificant coefficient is described in J. Sole, R. Joshi, I.-S. Chong,M. Coban, M. Karczewicz, “Parallel Context Processing for thesignificance map in high coding efficiency,” JCTVC-D262, 4th JCT-VCMeeting, Daegu, K R, January 2011, and in U.S. provisional patentapplication No. 61/419,740, filed Dec. 3, 2010, to Joel Sole Rojals etal., entitled “Encoding of the position of the last significanttransform coefficient in video coding.” Once the last significantcoefficient in the block is identified, then an inverse scan order canbe applied for both significance map and coefficient level.

This disclosure also proposes that the significance scan and coefficientlevel scan are not inverse and forward, respectively, but instead havethe same scan direction and, more particularly, only one direction in ablock. Specifically, it is proposed that the significance scan andcoefficient level scan both use an inverse scan order from the lastsignificant coefficient in a transform unit to the first coefficient.Hence, the significance scan is performed backwards (inverse scanrelative to the currently proposed scan for HEVC) from the lastsignificant coefficient to the first coefficient (the DC coefficient).This aspect of the disclosure presents a unified, uni-directional scanorder for coding of the significance map and coding of coefficientlevels. In particular, the unified, uni-directional scan order may be aunified inverse scan order. The scan orders for significance andcoefficient level scans according to a unified inverse scan patterncould be inverse diagonal, inverse zig-zag, inverse horizontal orinverse vertical as shown in FIG. 6. However, any scan pattern could beused.

Instead of defining sets of coefficients in two-dimensional sub-blocksas shown in FIG. 3 for the goal of CABAC context derivation, thisdisclosure proposes defining sets of coefficients as severalcoefficients that are consecutively scanned according to the scan order.In particular, each set of coefficients may comprise consecutivecoefficients in the scan order over the entire block. Any size of theset can be considered, although a size of 16 coefficients in a scan sethas been found to work well. The set size might be fixed or adaptive.This definition allows for sets to be 2-D blocks (if a sub-blockscanning method is used), rectangles (if horizontal or vertical scansare used), or diagonal shaped (if zig-zag or diagonal scans are used).The diagonal shaped sets of coefficients may be part of a diagonalshape, consecutive diagonal shapes, or parts of consecutive diagonalshapes.

FIGS. 7-9 show examples of coefficients arranged into 16 coefficientsub-sets according to specific scan orders beyond being arranged infixed 4×4 blocks. FIG. 7 depicts a 16 coefficient sub-set 51 thatconsists of the first 16 coefficients in an inverse diagonal scan order.The next sub-set, in this example, would simply consist of the next 16consecutive coefficients along the inverse diagonal scan order.Similarly, FIG. 8 depicts the 16 coefficient sub-set 53 for the first 16coefficients an inverse horizontal scan order. FIG. 9 depicts the 16coefficient sub-set 55 for the first 16 coefficients in an inversevertical scan order.

This technique is compatible with a scan order for the coefficientlevels that is the same as the scan order for the significance map. Inthis case, there is no need for a different (and sometimes cumbersome)scan order for the coefficients levels, such as that shown in FIG. 3.The coefficient level scan may be formed, like the significance map scanpresently proposed for HEVC, as a forward scan that proceeds from theposition of the last significant coefficient in a transform unit to theDC coefficient position.

As currently proposed in HEVC, for entropy coding using CABAC, transformcoefficients are encoded in the following way. First, there is one pass(in the significance map scan order) on the full transform unit toencode the significance map. Then, there are three passes (in thecoefficient level scan order) to encode bin 1 of the level (1st pass),the rest of the coefficient level (2nd pass) and the sign of thecoefficient level (3rd pass). These three passes for coefficient levelcoding are not done for the full transform unit. Instead, each pass isdone in 4×4 sub-blocks, as shown in FIG. 3. When the three passes havebeen completed in one sub-block, the next sub-block is processed bysequentially performing the same three encoding passes. This approachfacilitates the parallelization of the encoding.

As described above, this disclosure proposes to scan transformcoefficients in a more harmonized manner, such that the scan order forthe coefficient levels is the same as the scan order of significantcoefficients to form the significance map. In addition, it is proposedthat the scans for coefficient level and significant coefficients beperformed in an inverse direction that proceeds from the lastsignificant coefficient in the block to the first coefficient (the DCcomponent) in the block. This inverse scan is the opposite of the scanused for significant coefficients according to HEVC, as currentlyproposed.

As previously described with reference to FIGS. 7-9, this disclosurefurther proposes that the contexts for the coefficient levels (includingthe significance map) are divided into sub-sets. That is, a context isdetermined for each sub-set of coefficients. Hence, in this example, thesame context is not necessarily used for an entire scan of coefficients.Instead, different sub-sets of coefficients within a transform block mayhave different contexts that are individually determined for eachsub-set. Each sub-set may comprise a one-dimensional array ofconsecutively scanned coefficients in the scan order. Therefore, thecoefficient level scan goes from the last significant coefficient to thefirst coefficient (DC component), where the scan is conceptuallypartitioned in different sub-sets of consecutively scanned coefficientsaccording to the scan order. For example, each sub-set may include nconsecutively scanned coefficients, for a particular scan order.Grouping coefficients in sub-sets according to their scan order mayprovide for a better correlation between coefficients, and thus moreefficient entropy coding.

This disclosure further proposes to increase the parallelization of theCABAC-based entropy coding of the transform coefficients by extendingthe concept of the several passes of the coefficient level to include anadditional pass for the significance map. Thus, an example with fourpasses may include: (1) coding of significant coefficient flag valuesfor the transform coefficients, e.g., to form the significance map, (2)coding of bin 1 of level values for transform coefficients, (3) codingof remaining bins of the coefficient level values, and (4) coding of thesigns of the coefficient levels, all in the same scan order. Using thetechniques described in this disclosure, the four-pass coding outlinedabove can be facilitated. That is, scanning significant coefficients andlevels for transform coefficients in the same scan order, where the scanorder proceeds in an inverse direction from a high frequency coefficientto a low frequency coefficient, supports the performance of theseveral-pass coding technique described above.

In another example, a five pass scan technique may include: (1) codingof significant coefficient flag values for the transform coefficients,e.g., to form the significance map, (2) coding of bin 1 of level valuesfor transform coefficients, (3) coding of bin 2 of level values fortransform coefficients, (4) coding the signs of the coefficient levels(e.g., in bypass mode), and (5) coding of remaining bins of thecoefficient level values (e.g., in bypass mode), all passes using thesame scan order.

An example with fewer passes may also be employed. For example, a twopass scan where level and sign information are processed in parallel mayinclude: (1) coding regular pass bins in pass (e.g., significance, bin 1level, and bin 2 level), and (2) coding bypass bins in another (e.g.,remaining levels and sign), each pass using the same scan order. Regularbins are bins encoded with CABAC using updated context determined bycontext derivation criteria. For example, as will be explained in moredetail below, the context derivation criteria may include the codedlevel information of causal neighbor coefficient relative to a currenttransform coefficient. Bypass bins are bins encoded with CABAC having afixed context.

The examples the several scan passes described above may be generalizedas including a first scan pass of the first portion of the coefficientslevels, wherein the first portion includes the significance pass, and asecond scan pass of a second portion of the coefficient levels.

In each of the examples given above, the passes may be performedsequentially in each sub-set. Although the use of one-dimensionalsub-sets comprising consecutively scanned coefficients may be desirable,the several pass method also may be applied to sub-blocks, such as 4×4sub-blocks. Example two-pass and four-pass processes for consecutivelyscanned sub-sets are outlined in more detail below.

In a simplified two-pass process, for each sub-set of a transform unit,the first pass codes the significance of the coefficients in the sub-setfollowing the scan order, and the second pass codes the coefficientlevel of the coefficients in the sub-set following the same scan order.The scanning order may be characterized by a scan direction (forward orinverse) and a scan pattern (e.g., horizontal, vertical, or diagonal).The algorithm may be more amenable to parallel processing if both passesin each sub-set follow the same scan order, as described above.

In a more refined four-pass process, for each sub-set of a transformunit, the first pass codes the significance of the coefficients in thesub-set, the second pass codes bin 1 of the coefficient level of thecoefficients in the sub-set, the third pass codes the remaining bins ofthe coefficient level of the coefficients in the sub-set, and the fourthpass codes the sign of the coefficient level of the coefficients in thesub-set. Again, to be more amenable to parallel processing, all passesin each sub-set should have the same scan order. As is described above,a scan order with an inverse direction has been shown to work well. Itshould be noted that the fourth pass (i.e., the coding of the sign ofthe coefficient levels) may be done immediately after the first pass(i.e., the coding of the significance map) or right before the remainingvalues of the coefficient level pass.

For some transform sizes, the sub-set can be the entire transform unit.In this case, there is a single sub-set corresponding to all of thesignificant coefficients for an entire transform unit, and thesignificance scan and level scan proceed in the same scan order. In thiscase, instead of limited number of n (e.g., n=16) coefficients in asub-set, the sub-set could be a single sub-set for a transform unit,wherein the single subset includes all significant coefficients.

Returning to FIG. 5, once the transform coefficients are scanned, theentropy encoding unit 56 may apply entropy coding such as CAVLC or CABACto the coefficients. In addition, the entropy encoding unit 56 mayencode motion vector (MV) information and any of a variety of syntaxelements useful in decoding the video data at the video decoder 30. Thesyntax elements may include a significance map with significantcoefficient flags that indicate whether particular coefficients aresignificant (e.g., non-zero) and a last significant coefficient flagthat indicates whether a particular coefficient is the last significantcoefficient. The video decoder 30 may use these syntax elements toreconstruct the encoded video data. Following the entropy coding by theentropy encoding unit 56, the resulting encoded video may be transmittedto another device, such as the video decoder 30, or archived for latertransmission or retrieval.

To entropy encode the syntax elements, the entropy encoding unit 56 mayperform CABAC and select context models based on, for example, thenumber of significant coefficients in the previously scanned Ncoefficients, where N is an integer value that may be related to thesize of the block being scanned. The entropy encoding unit 56 may alsoselect the context model based on a prediction mode used to calculateresidual data that was transformed into the block of transformcoefficients, and a type of transform used to transform the residualdata into the block of transform coefficients. When the correspondingprediction data was predicted using an intra-prediction mode, theentropy encoding unit 56 may further base the selection of the contextmodel on the direction of the intra-prediction mode.

Further, according to another aspect of this disclosure, it is proposedthat the contexts for CABAC be divided into sub-sets of coefficients(e.g., the sub-sets shown in FIGS. 7-9. It is proposed that each sub-setis composed of consecutive coefficients in the scanning order over theentire block. Any size of the sub-set can be considered, although a sizeof 16 coefficients in a scan sub-set has been found to work well. Inthis example, a sub-set may be 16 consecutive coefficients in the scanorder, which may be in any scan pattern, including sub-block, diagonal,zig-zag, horizontal, and vertical scan patterns. According to thisproposal, the coefficient level scan proceeds from the last significantcoefficient in a block. Therefore, the coefficient level scan goes fromthe last significant coefficient to the first coefficient (DC component)in the block, where the scan is conceptually partitioned in differentsub-sets of coefficients in order to derive the contexts to apply. Forexample, the scan is arranged in sub-sets of n consecutive coefficientsin the scan order. The last significant coefficient is the firstsignificant coefficient encountered in an inverse scan from the highestfrequency coefficient of the block (typically found near the lower rightcorner of the block) toward the DC coefficient of the block (upper leftcorner of the block).

In another aspect of the disclosure, it is proposed that CABAC contextderivation criteria be harmonized for all block sizes. In other words,instead of having different context derivations based on block size asdiscussed above, every block size will rely on the same derivation ofCABAC contexts. In this way, there is no need to take into account thespecific block size in order to derive the CABAC context for the block.Context derivation is also the same for both significance coding andcoefficient level coding.

It is also proposed that CABAC context sets depend on whether thesub-set is sub-set 0 (defined as the sub-set with the coefficients forthe lowest frequencies, i.e., containing the DC coefficient and adjacentlow frequency coefficients) or not (i.e., the context derivationcriteria). See Tables 3a and 3b below.

TABLE 3a Context sets table. To be compared with Table 2. There is adependency on the sub-set, whether it is sub-set 0 (lowest frequencies)or not. Context Set 0 Lowest freq 0 LargerT1 in previous sub-set 1Lowest freq 1 LargerT1 in previous sub-set 2 Lowest freq >1 LargerT1 inprevious sub-set 3 Higher freq 0 LargerT1 in previous sub-set 4 Higherfreq 1 LargerT1 in previous sub-set 5 Higher freq >1 LargerT1 inprevious sub-set

Per Table 3a above, sets 0-2 of context models are used for the lowestfrequency scan sub-set (i.e., set of n consecutive coefficients) if,respectively, there are zero coefficients larger than one in thepreviously coded sub-set, there is one coefficient larger than one inthe previously coded sub-set, or there are more than one coefficientlarger than one in the previously coded sub-set. Sets 3-5 of contextmodels are used for all sub-sets higher than the lowest frequencysub-set if, respectively, there are there are zero coefficients largerthan one in the previously coded sub-set, there is one coefficientlarger than one in the previously coded sub-set, or there are more thanone coefficient larger than one in the previously coded sub-set.

TABLE 3b Context set table. Context Set 0 Lowest freq 0 LargerT1 inprevious sub-set 1 Lowest freq 1-3 LargerT1 in previous sub-set 2 Lowestfreq >3 LargerT1 in previous sub-set 3 Higher freq 0 LargerT1 inprevious sub-set 4 Higher freq 1-3 LargerT1 in previous sub-set 5 Higherfreq >3 LargerT1 in previous sub-set

Table 3b shows a context set table that has showed good performance asit accounts for a more precise count of the number of larger than onecoefficients in the previous sub-set. Table 3b may be used as analternative to Table 3a above.

Table 3c shows a simplified context set table with context derivationcriteria that may also be alternatively used.

TABLE 3c Context set table. Context Set 0 Lowest freq 0 LargerT1 inprevious sub-set 1 Lowest freq 1 LargerT1 in previous sub-set 2 Higherfreq 0 LargerT1 in previous sub-set 3 Higher freq 1 LargerT1 in previoussub-set

In addition, a sub-set containing the last significant coefficient inthe transform unit may utilize a unique context set.

This disclosure also proposes that the context for a sub-set stilldepends on the number of coefficients larger than 1 in previoussub-sets. For example, if the number of coefficients in previoussub-sets is a sliding window, let this number be uiNumOne. Once thisvalue is checked to decide the context for the current sub-scan set,then the value is not set to zero. Instead, this value is normalized(e.g., use uiNumOne=uiNumOne/4 which is equivalent to uiNumOne>>=2, oruiNumOne=uiNumOne/2 which is equivalent to uiNumOne>>=1). By doing this,values of sub-sets prior to the immediately previous sub-set can stillbe considered, but given smaller weight in the CABAC context decisionfor the currently coded sub-set. In particular, the CABAC contextdecision for a given sub-set takes into account not only the number ofcoefficients greater than one in the immediately preceding sub-set, butalso a weighted number of coefficients greater than one in previouslycoded sub-sets.

Additionally, the context set can depend on the following: (1) thenumber of significant coefficients in the currently scanned sub-set, (2)whether the current sub-set is the last sub-set with a significantcoefficient (i.e., using the inverse scan order, this refers to whetherthe sub-set is the first scanned for the coefficients levels or not).Additionally, the context model for a coefficient level can depend onwhether the current coefficient is the last coefficient.

A highly adaptive context selection approach has previously beenproposed for significance map coding of 16×16 and 32×32 blocks oftransform coefficients in HEVC. It should be noted that this contextselection approach may be extended to all block sizes. As shown in FIG.10, this approach divides a 16×16 block into four regions, where eachcoefficient in the lower frequency region 41 (the four coefficients atthe top left corner in x, y coordinate positions [0,0], [0,1], [1,0],[1,1] in the example of a 16×16 block, where [0,0] indicates the upperleft corner, DC coefficient) has its own context, the coefficients inthe top region 37 (coefficients in the top row from x, y coordinatepositions [2,0] to [15,0] in the example of a 16×16 block) share 3contexts, the coefficients in the left region 35 (coefficients in theleft column from x, y coordinate positions [0,2] to [0,15] in theexample of a 16×16 block) share another 3 contexts, and the coefficientsin the remaining region 39 (remaining coefficients in the 16×16 block)share 5 contexts. Context selection for transform coefficient X inregion 39, as an example, is based on the sum of the significance of amaximum of the 5 transform coefficients B, E, F, H, and I. Since X isindependent of other positions on the same diagonal line of X along thescan direction (in this example a zig-zag or diagonal scan pattern), thecontext of the significance of the transform coefficients along adiagonal line in scan order could be computed in parallel from theprevious diagonal lines in scan order.

The proposed contexts for the significance map, as shown in FIG. 10, areonly valid if the scan order is forward because the context becomesnon-causal at the decoder if an inverse scan is used. That is, thedecoder has not yet decoded coefficients B, E, F, H and I as shown inFIG. 10 if the inverse scan is used. As a result, the bitstream is notdecodable.

However, this disclosure proposes the use of an inverse scan direction.As such, the significance map has relevant correlation amongcoefficients when the scan order is in an inverse direction, as shown inFIG. 6. Therefore, using an inverse scan for the significance map, asdescribed above, offers desirable coding efficiency. Also, the use of aninverse scan for the significance map serves to harmonize the scanningused for coding of coefficient level and the significance map. Tosupport inverse scanning of the significant coefficients, the contextsneed to be changed so that they are compatible with an inverse scan. Itis proposed that coding of significant coefficients make use of contextsthat are causal with respect to the inverse scan.

This disclosure further proposes, in one example, a technique forsignificance map coding that makes use of the contexts depicted in FIG.11. Each coefficient in the lower frequency region 43 (the threecoefficients at the top left corner in x, y coordinate positions [0,0],[0,1], [1,0] in the example of a 16×16 block, where [0,0] indicates theupper left corner, DC coefficient) has its own context derivation. Thecoefficients in the top region 45 (coefficients in the top row from x, ycoordinate positions [2,0] to [15,0] in the example of a 16×16 block)have a context dependent on the significance of the two previouscoefficients in the top region 45 (e.g., two coefficients immediately tothe right of the coefficient to be coded, where such coefficients arecausal neighbors for decoding purposes given the inverse scan). Thecoefficients in the left region 47 (coefficients in the left column fromx, y coordinate positions [0,2] to [0,15] in the example of a 16×16block) have a context dependent on the significance of the two previouscoefficients (e.g., two coefficients immediately below the coefficientto be coded, where such coefficients are causal neighbors for decodingpurposes given the inverse scan orientation). Note that these contextsin the top region 45 and the left region 47 in FIG. 11 are the inverseof the contexts shown in FIG. 10 (e.g., where the coefficients in thetop region 37 have a context dependent on coefficients to the left andthe coefficients in the left region 35 have a context dependent oncoefficients above). Returning to FIG. 11, the contexts for thecoefficients in the remaining region 49 (i.e., the remainingcoefficients outside of lower frequency region 43, top region 45, andleft region 47) depend on the sum (or any other function) of thesignificance of the coefficients in the positions marked with I, H, F,E, and B.

In another example, the coefficients in top region 45 and left region 47may use exactly the same context derivation as the coefficients inregion 49. In the inverse scan, that is possible because the neighboringpositions marked with I, H, F, E, and B are available for thecoefficients in the top region 45 and the left region 47. At the end ofthe rows/columns, the positions for causal coefficients I, H, F, E and Bmight be outside the block. In that case, it is assumed that the valueof such coefficients is zero (i.e., non-significant).

There are many options in choosing the contexts. The basic idea is touse the significance of coefficients that have already been codedaccording to the scan order. In the example shown in FIG. 10, thecontext of the coefficient at position X is derived based on the sum ofthe significance of coefficients at positions B, E, F, H and I. Thesecontext coefficients come before the current coefficient in the inversescan order proposed in this disclosure for the significance map. Thecontexts that were causal in the forward scan become non-causal (notavailable) in the inverse scan order. A way to address this problem isto mirror the contexts of the conventional case in FIG. 10 to thoseshown in FIG. 11 for the inverse scan. For a significance scan thatproceeds in an inverse direction from a last significant coefficient toa DC coefficient position, the context neighborhood for coefficient X iscomposed of coefficients B, E, F, H, I, which are associated with higherfrequency positions, relative to the position of coefficient X, andwhich have already been processed by the encoder or decoder, in theinverse scan, prior to coding of coefficient X.

As discussed above, contexts and context models illustrated in Tables 1and 2 attempt to exploit the local correlation of coefficient levelsamong 4×4 sub-blocks. However, the dependency might be too far. That isto say, there may be a low dependency between coefficients which areseparated from one another by several coefficients, for example, fromone sub-block to another. Also, within each sub-block, the dependencybetween coefficients might be weak. This disclosure describes techniquesfor addressing these issues by the creation of a set of contexts for thecoefficient levels that exploit a more local context neighborhood.

This disclosure proposes to use a local neighborhood for the derivationof the context of the transform coefficient levels, e.g., in videocoding according to HEVC or other standards. This neighborhood iscomposed of coefficients already encoded (or decoded) that have highcorrelation with the level of the current coefficient. The coefficientsmay spatially neighbor the coefficient to be coded, and may include bothcoefficients that bound the coefficient to be coded and other nearbycoefficients, such as shown in FIG. 11 or FIG. 13. Notably, thecoefficients used for context derivation are not constrained to asub-block or previous sub-block. Instead, the local neighborhood maycomprise coefficients that are spatially located close to thecoefficient to be coded, but would not necessarily reside in the samesub-block as the coefficient to be coded, or in the same sub-block asone another, if the coefficients were arranged in sub-blocks. Ratherthan relying on coefficients located in a fixed sub-block, thisdisclosure proposes using neighboring coefficients that are available(i.e., have already been coded) given the specific scan order used.

Different CABAC context sets may be specified for different sub-sets ofcoefficients, e.g., based on previously coded sub-sets of coefficients.Within a given sub-set of coefficients, contexts are derived based on alocal neighborhood of coefficients, sometimes called a contextneighborhood. In accordance with this disclosure, an example of acontext neighborhood is shown in FIG. 12. The coefficients in thecontext neighborhood may be spatially located near the coefficient to becoded.

As shown in FIG. 12, for a forward scan, the context of the level forthe transform coefficient X depends on the values of the coefficients B,E, F, H, and I. In a forward scan, coefficients B, E, F, H, and I areassociated with lower frequency positions relative to the position andcoefficient X, and which have already been processed by the encoder ordecoder prior to coding of coefficient X.

For encoding bin 1 for CABAC, the context depends on the sum of thenumber of significant coefficients in this context neighborhood (i.e.,in this example, coefficients B, E, F, H and I). If a coefficient in thecontext neighborhood falls out of the block, i.e., due to data loss, itcan be considered that the value is 0 for purposes of determining thecontext of coefficient X. For encoding the rest of the bins for CABAC,the context depends on the sum of the number of coefficients in theneighborhood that are equal to 1 as well as on the sum of the number ofcoefficients in the neighborhood that are larger than 1. In anotherexample, the context for bin 1 may depend on the sum of the bin 1 valuesof the coefficients in the local context neighborhood. In anotherexample, the context for bin 1 may depend on a combination of the sum ofthe significance coefficients and bin 1 values in this contextneighborhood.

There are many possibilities for the selection of a contextneighborhood. However, the context neighborhood should be composed ofcoefficients such that encoder and decoder both have access to the sameinformation. In particular, the coefficients B, F, E, I, and H in theneighborhood should be causal neighbors in the sense that they have beenpreviously encoded or decoded and are available for reference indetermining the context for coefficient X.

The contexts described above with reference to FIG. 12 are one of manypossibilities. Such contexts can be applied to any of the three scanscurrently proposed for use in HEVC: diagonal, horizontal and vertical.This disclosure proposes that the context neighborhood used to derivethe context for the coefficient level may be the same as the contextneighborhood used for deriving contexts for the significance map. Forexample, the context neighborhood used to derive the context for thecoefficient level may be a local neighborhood, as is the case for thecoding of the significance map.

As described in more detail above, this disclosure proposes the use ofan inverse scan order for the scanning of significant coefficients toform the significance map. The inverse scan order may be an inversezig-zag pattern, vertical pattern or horizontal pattern as shown in FIG.6. If the scan order for the coefficient level scan is also in aninverse pattern, then the context neighborhood shown in FIG. 12 wouldbecome non-causal. This disclosure proposes to reverse the position ofthe context neighborhood so that they are causal with reference to aninverse scan order. FIG. 13 shows an example of a context neighborhoodfor an inverse scan order.

As shown in FIG. 13, for a level scan that proceeds in an inversedirection from a last significant coefficient to a DC coefficientposition, the context neighborhood for coefficient X is composed ofcoefficients B, E, F, H, and I, which are associated with higherfrequency positions relative to the position of coefficient X. Given theinverse scan, coefficients B, E, F, H, and I have already been processedby the encoder or decoder, prior to coding of coefficient X, and aretherefore causal in the sense that they are available. Similarly, thiscontext neighborhood can be applied to the coefficient levels.

This disclosure further proposes, in one example, another technique forsignificance map coding that makes use of the contexts selected tosupport an inverse scan. As discussed above, a highly adaptive contextselection approach has been proposed for HEVC for significance mapcoding of 16×16 and 32×32 blocks of transform coefficients. Forinstance, as was described in reference to FIG. 10 above, this approachdivides a 16×16 block into four regions, where each position in theregion 41 has its own set of contexts, region 37 has contexts, region 35has another 3 contexts, and region 39 has 5 contexts. Context selectionfor transform coefficient X, as an example, is based on the sum of thesignificance of a maximum of the 5 positions B, E, F, H, I. Since X isindependent of other positions on the same diagonal line of X along thescan direction, the context of the significance of the transformcoefficients along a diagonal line in scan order could be computed inparallel from the previous diagonal lines in scan order.

The current HEVC approach for context derivations has several drawbacks.One issue is the number of contexts per block. Having more contextsimplies more memory and more processing each time the contexts arerefreshed. Therefore, it would be beneficial to have an algorithm thathas few contexts and also, few ways to generate the contexts (e.g., lessthan the four ways, i.e., four patterns, in the previous example).

One way to address such drawbacks is the coding of the significance mapin inverse order, that is, from the last significant coefficient (higherfrequency) to the DC component (lowest frequency). A consequence of thisprocess in inverse order is that the contexts for the forward scanningare no longer valid. The techniques described above include a method fordetermining the contexts for context adaptive binary arithmetic coding(CABAC) of the information indicating a current one of the significantcoefficients based on previously coded significant coefficients in theinverse scan direction. In an example of inverse zig-zag scan, thepreviously coded significant coefficients reside at positions to theright of a scan line on which the current of the significantcoefficients resides.

The context generation might be different for different positions of thetransform blocks based on, at least, the distance from the boundariesand the distance from the DC component. In the example techniquedescribed above, it was proposed that the significance map coding makesuse of the sets of contexts depicted in FIG. 11.

This disclosure proposes a set of contexts for inverse significance mapscan that may lead to higher performance through the reduction of thenumber of contexts per block. Referring back to FIG. 11, a reduction inthe number of context per block may be accomplished by allowing the leftregion 47 and top region 45 to use the same context derivation as theremaining region 49. In the inverse scan that is possible because theneighboring positions marked with I, H, F, E, and B are available forthe coefficients at the regions 47 and 45.

FIG. 14 shows an example of a context derivation according to thisexample. In this example there are only two context regions: a lowfrequency region 57 for the DC coefficient and the remaining region 59for all other coefficients. As such, this example proposes just two waysto derive the context. In the low frequency region 57 (the DCcoefficient at x, y position [0,0]), the context is derived based on theposition, i.e., the DC coefficient has a context of its own. In theremaining region 57, the context is derived based on the significance ofthe neighbor coefficients in the local neighborhood for each coefficientto be coded. In this example, it is derived depending on the sum of thesignificance of the 5 neighbors denoted by I, H, F, E and B in FIG. 14.

Therefore, the number of ways to derive the context within a block isreduced from 4 to 2. Also, the number of contexts is reduced by 8 withrespect to the previous example in FIG. 11 (2 lower frequency region 43and 3 for each of upper region 45 and left region 47). In anotherexample, the DC coefficient may use the same method as the rest of theblock, so the number of ways to derive the context within a block isreduced to 1.

FIG. 15 shows an example where the current position of coefficient Xcauses some of the neighbor coefficients (in this case H and B) to beoutside of the current block. If any of the neighbors of the currentcoefficient are outside the block it may be assumed that such neighborcoefficients have 0 significance (i.e., they are zero-valued andtherefore non-significant). Alternatively, one or more special contextsmay be specified for one or more coefficients at the lower right. Inthis way, higher frequency coefficients may have contexts depending onposition, in a similar way as the DC coefficient. However, assuming theneighbors to be zero may provide sufficient results, particularlybecause the lower right coefficients will ordinarily have a lowprobability of having significant coefficients, or at least significantcoefficients with large values.

The reduction of the number contexts in the example of FIG. 14 is goodfor implementation. However, it may result in a small drop inperformance. This disclosure proposes a further technique to improve theperformance while still reducing the number of contexts. In particular,it is proposed to have a second set of contexts that is also based onneighbor coefficients. The context derivation algorithm is exactly thesame, but two sets of contexts with different probability models areused. The set of contexts that are used depends on the position of thecoefficient to be coded within the transform unit.

More specifically, increased performance has been shown when using acontext model for higher frequency coefficients (e.g., lower right x, ycoordinate positions of coefficients) that is different from the contextmodel for coefficients at lower frequencies (e.g., upper left x, ycoordinate positions of coefficients). One way to separate the lowerfrequency coefficients from the higher frequency coefficients, and thusthe context model used for each, is to compute the x+y value for acoefficient, where x is the horizontal position and y is the verticalposition of the coefficient. If this value is smaller than somethreshold (e.g., 4 has been shown to work well), then context set 1 isused. If the value is equal to or larger than the threshold, thencontext set 2 is. Again, context sets 1 and 2 have different probabilitymodels.

FIG. 16 shows an example of the context regions for this example. Again,the DC coefficient at position (0,0) has its own context region 61. Thelower frequency context region 63 consists of transform coefficients atan x+y position equal to or less than a threshold of 4 (not includingthe DC coefficient). The higher frequency context region 65 consists oftransform coefficients at an x+y position greater than a threshold of 4.The threshold of 4 is used an example and may be adjusted to any numberthat provides for better performance. In another example, the thresholdmay depend on the TU size.

The context derivation for the lower frequency context region 63 and thehigher frequency context region 65 is exactly the same in terms of themanner in which the neighbors are used to select context, but theemployed probabilities (i.e., contexts) are different. In particular,the same criteria for context selection based on neighbors may be used,but the application of such criteria leads to selection of a differentcontext for different coefficient positions, because differentcoefficient positions may be associated with different sets of contexts.In this way, the knowledge that lower and high frequency coefficientshave different statistics is incorporated in the algorithm, so thatdifferent context sets for different coefficient may be used.

In other examples, the x+y function can be changed to other functionsdepending on the position of the coefficient. For instance, an option isto give the same set of contexts to all the coefficients with x<T &&y<T, T being a threshold. FIG. 17 shows an example of a block oftransform coefficients with these context regions. Again, the DCcoefficient at position (0,0) may have its own context region 61. Thelower frequency context region 73 consists of all transform coefficientswhose X or Y position is less than or equal to a threshold of 4 (notincluding the DC coefficient). The higher frequency context regionconsists of all transform coefficients whose X or Y position is greaterthan a threshold of 4. Again, the threshold of 4 is used as an exampleand may be adjusted to any number that provides for better performance.In one example, the threshold may depend on the TU size.

The above described techniques shown in FIGS. 16 and 17 have two sets of5 contexts, which is still a lesser number of contexts than the numberof contexts shown in FIG. 10, and exhibits higher performance. This isachieved by separating the block into different areas, and specifyingdifferent context sets for the coefficients in the different areas, butstill applying the same context derivation criteria to each area.

FIG. 18 shows another example of a block of transform coefficients withcontext regions. In this example, the DC coefficient in region 81 andthe coefficients at x, y positions (1, 0) and (0, 1), in regions 83 and85, each have their own context. The remaining region 87 has yet anothercontext. In a variation of the example shown in FIG. 18, regions 83 and85 share a context.

In general, the above-described techniques may include scanningsignificant coefficients in a block of transform coefficients in aninverse direction from higher frequency coefficients in the block of thetransform coefficients to lower frequency coefficients in the block oftransform coefficients to form a significance map, and determiningcontexts for context adaptive binary arithmetic coding (CABAC) of thesignificant coefficients of the significance map based on a localneighborhood of previously scanned coefficients in the block. Thecontexts may be determined for each of the significant coefficientsbased on previously scanned transform coefficients in the localneighborhood having higher frequencies than the respective transformcoefficient. In some examples, the contexts may be determined based on asum of the number of significant coefficients in previously scannedcoefficients of a context neighborhood. The local neighborhood for eachof the significant coefficients to be coded may comprise a plurality oftransform coefficients that spatially neighbor the respectivecoefficient in the block.

A context for a significant coefficient at a DC (e.g., upper left-most)position of the block of transform coefficients may be determined basedon an individual context specified for the significant coefficient atthe DC position. Also, a context may be determined for coefficients at aleft edge and top edge of the block using criteria substantially similaror identical to criteria used to determine context for coefficients thatare not at the left edge and top edge of the block. In some examples,context for a coefficient at lower right-most position of the block maybe determined using criteria that assumes that neighboring coefficientsoutside of the block are zero-valued coefficients. Also, in someexamples, determining a context may comprise determining a context forcoefficients using substantially similar or identical criteria forselection of contexts within a context set, but different context sets,based on positions of the coefficients within the block of transformcoefficients.

Reference to upper, lower, right, left, and the like in this disclosureis used generally for convenience to refer to relative positions ofhigher frequency and lower frequency coefficients in a block oftransform coefficients that is arranged, in a conventional manner, tohave lower frequency coefficients toward the upper left and higherfrequency coefficients toward the lower right of the block, and shouldnot be considered limiting for cases in which the higher and lowerfrequency coefficients may be arranged in a different, unconventionalmanner.

Returning to FIG. 5, in some examples, the transform module 52 may beconfigured to zero out certain transform coefficients (that is,transform coefficients in certain locations). For example, the transformmodule 52 may be configured to zero out all transform coefficientsoutside of the upper-left quadrant of the TU following the transform. Asanother example, the entropy encoding unit 56 may be configured to zeroout transform coefficients in the array following a certain position inthe array. In any case, the video encoder 20 may be configured to zeroout a certain portion of the transform coefficients, e.g., before orafter the scan. The phrase “zero out” is used to mean setting the valueof the coefficient equal to zero, but not necessarily skipping ordiscarding the coefficient. In some examples, this setting ofcoefficients to zero may be in addition to the zeroing out that mayresult from quantization.

The inverse quantization unit 58 and the inverse transform module 60apply inverse quantization and inverse transformation, respectively, toreconstruct the residual block in the pixel domain, e.g., for later useas a reference block. The motion compensation unit 44 may calculate areference block by adding the residual block to a predictive block ofone of the frames of the reference frame buffer 64. The motioncompensation unit 44 may also apply one or more interpolation filters tothe reconstructed residual block to calculate sub-integer pixel valuesfor use in motion estimation. The summer 62 adds the reconstructedresidual block to the motion compensated prediction block produced bythe motion compensation unit 44 to produce a reconstructed video blockfor storage in the reference frame buffer 64. The reconstructed videoblock may be used by the motion estimation unit 42 and the motioncompensation unit 44 as a reference block to inter-code a block in asubsequent video frame.

FIG. 19 is a block diagram illustrating an example of an entropyencoding unit 56 for use in the video encoder of FIG. 5. FIG. 19illustrates various functional aspects of the entropy encoding unit 56for selecting a scan order and corresponding context set used in CABACentropy coding. The entropy encoding unit 56 may include a scan orderand context selection unit 90, a 2D-to-1D scan unit 92, an entropyencoding engine 94, and a scan order memory 96.

The scan order and context selection unit 90 selects the scan order tobe used by the 2D-to-1D scan unit 92 for the significance map scan andthe coefficient level scan. As discussed above, the scan order consistsof both a scan pattern and a scan direction. The scan memory 96 maystore instructions and/or data that defines what scan order to use forparticular situations. As examples, the prediction mode of a frame orslice, the block size, the transform, or other characteristics of thevideo data used may be used to select the scan order. In one proposalfor HEVC, each of the intra prediction modes is assigned to a particularscan order (sub-block diagonal, horizontal or vertical). The decoderparses the intra prediction mode, and determines the scan order to applyusing look-up-table. Adaptive methods may be used to track thestatistics of the most frequent significant coefficients. In anotherexample, a scan may be based on the most frequently used coefficientsfirst in scan order. As another example, the scan order and contextselection unit 90 may use a predetermined scan order for all situations.As described above, the scan order and context selection unit 90 mayselect a scan order for both a significance map and a coefficient levelscan. In accordance with techniques of this disclosure, the two scansmay have the same scan order, and in particular, may both be in aninverse direction.

Based on the selected scan order, the scan order and context selectionunit 90 also selects the contexts to be used for CABAC in the entropyencoding engine 94, such as the contexts described above with referenceto FIG. 11 and FIGS. 13-18.

The 2D-to-1D scan unit 92 applies the selected scans to thetwo-dimensional array of transform coefficients. In particular, the2D-to-1D scan unit 92 may scan the transform coefficients in sub-sets,as is described above with reference to FIGS. 7-9. In particular,transform coefficients are scanned in a sub-set consisting of a numberof consecutive coefficients according to the scan order. Such sub-setsare applicable for both the significance map scan as well as thecoefficient level scan. Additionally, the 2D-to-1D scan unit 92 mayperform significance map and coefficient level scans as consecutivescans and according to the same scan order. The consecutive scans mayconsist of several scans, as described above. In one example, the firstscan is the significance map scan, the second scan is of bin one of thelevels of transform coefficients in each sub-set, the third scan is ofthe remaining bins of the levels of transform coefficients, and thefourth scan is of the sign of the levels of transform coefficients.

The entropy encoding engine 94 applies an entropy encoding process tothe scanned coefficients using the selected context from the scan orderand context selection unit 90. In some examples the context used forCABAC may be predetermined for all cases, and as such, there may be noneed for a process or unit to select the contexts. The entropy encodingprocess may be applied to the coefficients after they are fully scannedinto the 1D vector, or as each coefficient is added to the 1D vector. Inother examples, the coefficients are processed directly in the 2D arrayusing the scan order. In some cases, the entropy encoding engine 94 maybe configured to encode different sections of the 1D vector in parallelto promote parallelization of the entropy encoding process for increasedspeed and efficiency. The entropy encoding engine 94 produces abitstream carrying the encoded video. The bitstream may be transmittedto another device or stored in a data storage archive for laterretrieval. In addition to the residual transform coefficient data, thebitstream may carry motion vector data and various syntax elementsuseful in decoding the encoded video in the bitstream.

In addition, the entropy encoding unit 56 may provide signaling in theencoded video bitstream to indicate the scan order and/or contexts usedin the CABAC process. The scan order and/or contexts may be signaled,for example, as syntax elements at various levels, such as the frame,slice, LCU, CU level or TU level. If a predetermined scan order and/orcontext are set, there may be no need to provide signaling in theencoded bitstream. Also, in some examples, it may be possible for thevideo decoder 30 to infer some of the parameter values withoutsignaling. To permit definition of different scan orders for differentTU's, it may be desirable to signal such syntax elements at the TUlevel, e.g., in a TU quadtree header. Although signaling in the encodedvideo bitstream is described for purposes of illustration, informationindicating the parameter values or function could be signaledout-of-band in side information.

In this context, signaling the scan order and/or contexts in the encodedbitstream does not require real-time transmission of such elements fromthe encoder to a decoder, but rather means that such syntax elements areencoded into the bitstream and are made accessible to the decoder in anyfashion. This may include real-time transmission (e.g., in videoconferencing) as well as storing the encoded bitstream on acomputer-readable medium for future use by a decoder (e.g., instreaming, downloading, disk access, card access, DVD, Blu-ray, etc.).

It should be noted that, although shown as separate functional units forease of illustration, the structure and functionality of the scan orderand context selection unit 90, the 2D-to-1D scan unit 92, the entropyencoding engine 94, and the scan order memory 96 may be highlyintegrated with one another.

FIG. 20 is a block diagram illustrating an example of a video decoder30, which decodes an encoded video sequence. In the example of FIG. 20,the video decoder 30 includes an entropy decoding unit 70, a motioncompensation unit 72, an intra-prediction module 74, an inversequantization unit 76, an inverse transformation unit 78, a referenceframe buffer 82 and a summer 80. The video decoder 30 may, in someexamples, perform a decoding pass generally reciprocal to the encodingpass described with respect to the video encoder 20 (FIG. 5).

The entropy decoding 70 entropy decodes the encoded video in a processthat is the inverse of that used by entropy encoding unit 56 of FIG. 5.The motion compensation unit 72 may generate prediction data based onmotion vectors received from the entropy decoding unit 70. Theintra-prediction module 74 may generate prediction data for a currentblock of a current frame based on a signaled intra-prediction mode anddata from previously decoded blocks of the current frame.

In some examples, the entropy decoding unit 70 (or the inversequantization unit 76) may scan the received values using a scanmirroring the scan order used by the entropy encoding unit 56 (or thequantization unit 54) of the video encoder 20. Although the scanning ofcoefficients may be performed in the inverse quantization unit 76,scanning will be described for purposes of illustration as beingperformed by the entropy decoding unit 70. In addition, although shownas separate functional units for ease of illustration, the structure andfunctionality of the entropy decoding unit 70, the inverse quantizationunit 76, and other units of the video decoder 30 may be highlyintegrated with one another.

In accordance with the techniques of this disclosure, the video decoder30 may scan both the significance map of the transform coefficients aswell as levels of the transform coefficients according to the same scanorder. That is to say, the scan order for the significance map and thelevel coding should have the same pattern and direction. In addition,the video encoder 30 may use a scan order for the significance map thatis in the inverse direction. As another example, the video encoder 30may use a scan order for the significance map the level coding that isharmonized in an inverse direction.

In another aspect of this disclosure, the video decoder 30 may scantransform coefficients in sub-sets. In particular, transformcoefficients are scanned in a sub-set consisting of a number ofconsecutive coefficients according to the scan order. Such sub-sets areapplicable for both the significance map scan as well as the coefficientlevel scan. Additionally, the video decoder 30 may perform thesignificance map scan and the coefficient level scan as consecutivescans according to the same scan order. In one aspect, the scan order isan inverse scan order. The consecutive scans may consist of severalscans. In one example, the first scan is the significance map scan, thesecond scan is of bin one of the levels of transform coefficients ineach sub-set, the third scan is of the remaining bins of the levels oftransform coefficients, and the fourth scan is of the sign of the levelsof transform coefficients.

The video decoder 30 may receive, from encoded bitstream, signaling thatidentifies the scan order and/or contexts used for CABAC by the videoencoder 20. Additionally, or alternatively, the scan order and contextsmay be inferred by the video decoder 30 based on characteristics of thecoded video such as prediction mode, block size, or othercharacteristics. As another example, the video encoder 20 and the videodecoder 30 may use predetermined scan orders and contexts for all usecases, and as such, no signaling in the encoded bitstream would beneeded.

No matter how the scan order is determined, the entropy decoding unit 70uses the inverse of the scan order to scan the 1D vector into the 2Darray. The 2D array of transform coefficients produced by the entropydecoding unit 70 may be quantized and may generally match the 2D arrayof transform coefficients scanned by the entropy encoding unit 56 of thevideo encoder 20 to produce the 1D vector of transform coefficients.

The inverse quantization unit 76 inverse quantizes, i.e., de-quantizes,the quantized transform coefficients provided in the bitstream anddecoded by the entropy decoding unit 70. The inverse quantizationprocess may include a conventional process, e.g., similar to theprocesses proposed for HEVC or defined by the H.264 decoding standard.The inverse quantization process may include use of a quantizationparameter QP calculated by the video encoder 20 for the CU to determinea degree of quantization and, likewise, a degree of inverse quantizationthat should be applied. The inverse quantization unit 76 may inversequantize the transform coefficients either before or after thecoefficients are converted from a 1D vector to a 2D array.

The inverse transform module 78 applies an inverse transform, e.g., aninverse DCT, an inverse integer transform, an inverse KLT, an inverserotational transform, an inverse directional transform, or anotherinverse transform. In some examples, the inverse transform module 78 maydetermine an inverse transform based on signaling from the video encoder20, or by inferring the transform from one or more codingcharacteristics such as block size, coding mode, or the like. In someexamples, the inverse transform module 78 may determine a transform toapply to the current block based on a signaled transform at the rootnode of a quadtree for an LCU including the current block. In someexamples, the inverse transform module 78 may apply a cascaded inversetransform.

The motion compensation unit 72 produces motion compensated blocks,possibly performing interpolation based on interpolation filters.Identifiers for interpolation filters to be used for motion estimationwith sub-pixel precision may be included in the syntax elements. Themotion compensation unit 72 may use interpolation filters as used by thevideo encoder 20 during encoding of the video block to calculateinterpolated values for sub-integer pixels of a reference block. Themotion compensation unit 72 may determine the interpolation filters usedby the video encoder 20 according to received syntax information and usethe interpolation filters to produce predictive blocks.

The motion compensation unit 72 and the intra-prediction module 74, inan HEVC example, may use some of the syntax information (e.g., providedby a quadtree) to determine sizes of LCUs used to encode frame(s) of theencoded video sequence. The motion compensation unit 72 and theintra-prediction module 74 may also use syntax information to determinesplit information that describes how each CU of a frame of the encodedvideo sequence is split (and likewise, how sub-CUs are split). Thesyntax information may also include modes indicating how each split isencoded (e.g., intra- or inter-prediction, and for intra-prediction anintra-prediction encoding mode), one or more reference frames (and/orreference lists containing identifiers for the reference frames) foreach inter-encoded PU, and other information to decode the encoded videosequence.

The summer 80 combines the residual blocks with the correspondingprediction blocks generated by the motion compensation unit 72 or theintra-prediction module 74 to form decoded blocks. If desired, adeblocking filter may also be applied to filter the decoded blocks inorder to remove blockiness artifacts. The decoded video blocks are thenstored in the reference frame buffer 82, which provides reference blocksfor subsequent motion compensation and also produces decoded video forpresentation on a display device (such as the display device 32 of FIG.4).

As mentioned above, the techniques for scanning transform coefficientspresented in this disclosure are applicable for both an encoder and adecoder. A video encoder may apply the scan order to scan transformcoefficients from the two-dimensional array to the one-dimensionalarray, whereas a video decoder may apply the scan order, e.g., in aninverse manner to the encoder, to scan transform coefficients from theone-dimensional array to the two-dimensional array. Alternatively, avideo decoder may apply the scan order to scan transform coefficientsfrom the one-dimensional array to the two-dimensional array, and a videoencoder may apply the scan order, in an inverse manner to the decoder,to scan transform coefficients from the two-dimensional array to theone-dimensional array. Hence, scanning by a coder may refer to 2D-to-1Dscanning by an encoder or 1D-to-2D scanning by a decoder. In addition,scanning according to a scan order may refer to scanning in the scanorder for 2D-to-1D scanning, scanning in the scan order for 1D-to-2Dscanning, scanning in the inverse of the scan order for 1D-to-2Dscanning, or scanning in the inverse of the scan order for 2D-to-1Dscanning. Hence, the scan order may be established for scanning by theencoder or scanning by the decoder.

The video decoder 30 may operate in a manner essentially symmetrical tothat of the video encoder 20. For example, the video decoder 30 mayreceive entropy encoded data representative of an encoded CU, includingencoded PU and TU data. The video decoder 30 may inverse entropy encodethe received data, forming encoded quantization coefficients. When thevideo encoder 20 entropy encodes data using an arithmetic codingalgorithm (e.g., CABAC), the video decoder 30 may use a context model todecode the data, which corresponds to the same context model used by thevideo encoder 20 to encode the data.

The video decoder 30 may also inverse scan the decoded coefficients,using an inverse scan that mirrors the scan used by the video encoder20. To inverse scan the coefficients, the video decoder 30 selects thesame scan order used by the video encoder 20, which may be stored at thedecoder or signaled by the encoder in the encoded bitstream. Using thisscan order, the video decoder 30 thereby forms a two-dimensional matrixfrom the one-dimensional vector of quantized transform coefficientsresulting from the entropy decoding process. In particular, videodecoder 30 inverse scans the coefficients from the one-dimensional arrayinto a two-dimensional array according to the scan order used by videoencoder 20.

Next, the video decoder 30 may inverse quantize the coefficients in thetwo-dimensional matrix produced by the inverse scan performed accordingto the scan order. The video decoder 30 may then apply one or moreinverse transforms to the two-dimensional matrix. The inverse transformsmay correspond to the transforms applied by the video encoder 20. Thevideo decoder 30 may determine the inverse transforms to apply based on,for example, information signaled at the root of a quadtreecorresponding to the CU currently being decoded, or by reference toother information indicative of the appropriate inverse transforms. Uponapplication of the inverse transform(s), the video decoder 30 recoversthe residual video data in the pixel domain and applies intra-predictiveor inter-predictive decoding, as applicable, to reconstruct the originalvideo data.

FIG. 21 is a block diagram illustrating an example of an entropydecoding unit 70 for use in the video decoder of FIG. 20. FIG. 21illustrates various functional aspects of the entropy decoding unit 70for selecting a scan order and contexts used for CABAC decoding in avideo decoding process. As shown in FIG. 21, the entropy encoding unit70 may include a scan order and context selection unit 100, a 1D-to-2Dscan unit 102, an entropy decoding engine 104, and a scan order memory106.

The entropy decoding engine 104 entropy decodes encoded videotransmitted to the video decoder 30 or retrieved by the video decoder 30from a storage device. For example, the entropy decoding engine 104 mayapply an entropy decoding process, e.g., CAVLC, CABAC or anotherprocess, to the bitstream carrying the encoded video to recover the 1Dvector of transform coefficients. In addition to the residual transformcoefficient data, the entropy decoding engine 104 may apply entropydecoding to reproduce motion vector data and various syntax elementsuseful in decoding the encoded video in the bitstream. The entropydecoding engine 104 may determine which entropy decoding process, e.g.,CAVLC, CABAC or another process, to select based on signaling in theencoded video bitstream or by inferring the appropriate process fromother information in the bitstream.

In accordance with the techniques of this disclosure, the entropydecoding engine 104 may entropy decode the encoded video using CABAC inaccordance with two different context regions. The scan order andcontext selection unit 100 may provide the context derivation to theentropy decoding engine 104. According to examples of this disclosure,the context derivation for a first context region depends on theposition of the transform coefficients while the context derivation forthe second region depends on causal neighbors of the transformcoefficients. In another example, the second context region can use twodifferent context models depending on the location of the transformcoefficients.

The scan order and context selection unit 100 may also determine thescan order, and/or an indication of the scan order, based on signalingin the encoded video bitstream. For example, entropy decoding unit 70may receive syntax elements that explicitly signal the scan order.Again, although signaling in the encoded video bitstream is describedfor purposes of illustration, the scan order could be received byentropy decoding unit 70 as out-of-band in side information. Also, insome examples, it may be possible for the scan order and contextselection unit 100 to infer the scan order without signaling. The scanorder may be based on prediction mode, block size, transform, or othercharacteristics of the encoded video. Like the memory 96 of FIG. 19, thememory 106 of FIG. 21 may store instructions and/or data defining thescan order.

The 1D-to-2D scan unit 102 receives the scan order from scan order andcontext selection unit 100 and applies the scan order, either directlyor in an inverse manner, to control the scanning of coefficients. Inaccordance with techniques of this disclosure, the same scan order maybe used for both the significance map scan and the coefficient level. Inanother aspect of the disclosure, the significance map scan may be in aninverse direction. In another aspect of the disclosure, both thesignificance map scan and the coefficient level scan may be in theinverse direction.

According to another aspect of the disclosure, the 1D-to-2D scan unit102 may scan the one-dimensional array of transform coefficients intoone or more sub-sets of transform coefficients, coding significance oftransform coefficients in each sub-set, and coding levels of transformcoefficients in each sub-set. In another aspect of the disclosure, thesignificance map and the coefficient level scan are performed inconsecutive scans according to the same scan order. In one aspect, thescan order is an inverse scan order. The consecutive scans may consistof several scans where the first scan is the significance map scan, thesecond scan is of bin one of the levels of transform coefficients ineach sub-set, the third scan is of the remaining bins of the levels oftransform coefficients, and the fourth scan is of the sign of the levelsof transform coefficients.

On the encoder side, coding of the transform coefficients may compriseencoding the transform coefficients according to the scan order to formthe one-dimensional array of the transform coefficients. On the decoderside, coding the transform coefficient may comprise decoding thetransform coefficients according to the scan order to reconstruct atwo-dimensional array of the transform coefficients in the transformblock.

It should be noted that, although shown as separate functional units forease of illustration, the structure and functionality of the scan orderand context selection unit 100, the 1D-to-2D scan unit 102, the entropydecoding engine 104, and the scan order memory 106 may be highlyintegrated with one another.

FIG. 22 is a flowchart illustrating an example process for significancemap and coefficients level scanning with a harmonized scan order. Amethod of coding a plurality of transform coefficients associated withresidual video data in a video coding process is proposed. The methodmay be performed by a video coder, such as video encoder 20 or videodecoder 30 of FIG. 4. The video coder may be configured to select a scanorder (120). The scan order may be selected based on prediction mode,block size, transform, or other video characteristics. In addition, thescan order may be a default scan order. The scan order defines both ascan pattern and a scan direction. In one example, the scan direction isan inverse scan direction proceeding from higher frequency coefficientsin the plurality of transform coefficients to lower frequencycoefficients in the plurality of transform coefficients. The scanpattern may include one of a zig-zag pattern, a diagonal pattern, ahorizontal pattern or a vertical pattern.

The video coder may be further configured to code information indicatingsignificant coefficients for the plurality of transform coefficientsaccording to a scan order (122) and determine contexts for coding thelevels of the significant coefficients for a plurality of sub-sets ofthe significant coefficients, wherein each of the plurality of sub-setscomprises one or more significant coefficients scanned according to thescan order (124). The video coder also codes information indicatinglevels of the plurality of transform coefficients according to the scanorder (126). The sub-sets may be of different sizes. It should be notedthat steps 122, 124 and 126 may be interleaved, as the determination ofcontexts for level information depends on the previously coded neighborcoefficients.

FIG. 23 is a flowchart illustrating another example process forsignificance map and coefficients level scanning and CABAC contextderivation. The method of FIG. 23 slightly differs from that shown inFIG. 22, as contexts of blocks of different sizes may use the samecontext derivation criteria. As one example, the video coder may derivea first context for a first block of the transform coefficients, thefirst block having a first size, according to context derivationcriteria, and derive a second context for a second block of thetransform coefficients, the second block having a second, differentsize, according to the same context derivation criteria as the firstblock (123). Like FIG. 22, steps 122, 123 and 126 may be interleaved, asthe determination of contexts for level information depends on thepreviously coded neighbor coefficients.

FIG. 24 is a flowchart illustrating another example process forsignificance map and coefficients level scanning and CABAC contextderivation. The method of FIG. 24 slightly differs from that shown inFIG. 22, as contexts for the sub-sets are determined based on thepresence of the DC coefficient in the sub-sets. As one example, thevideo coder may determine different sets of contexts for differentsub-sets of the coefficients based on whether the respective sub-setscontain a DC coefficient of the transform coefficients (125). Like FIG.22, steps 122, 125 and 126 may be interleaved, as the determination ofcontexts for level information depends on the previously coded neighborcoefficients.

FIG. 25 is a flowchart illustrating another example process forsignificance map and coefficients level scanning and CABAC contextderivation. The method of FIG. 25 slightly differs from that shown inFIG. 22, as contexts are determined based on a weighted number ofsignificant coefficients in other preceding subsets. As one example, thevideo coder may determine different sets of contexts for differentsub-sets of the coefficients based a number of significant coefficientsin an immediately preceding sub-set of the coefficients and a weightednumber of significant coefficients in other preceding sub-sets of thecoefficients (127). Like FIG. 22, steps 122, 127 and 126 may beinterleaved, as the determination of contexts for level informationdepends on the previously coded neighbor coefficients.

FIG. 26 is a flowchart illustrating an example process for significancemap coding using an inverse scan direction. A method of coding transformcoefficients associated with residual video data in a video codingprocess is proposed. The method may be performed by a video coder, suchas video encoder 20 or video decoder 30 of FIG. 4. The video coder maybe configured to select a scan order with an inverse direction (140) andto determine contexts for context adaptive binary arithmetic coding(CABAC) of the information indicating a current one of the significantcoefficients based on previously coded significant coefficients in theinverse scan direction (142). The video coder may further be configuredcode information indicating the significant transform coefficients alongthe inverse scan direction to form a significance map (146).

In one example, the scan has a diagonal pattern and the previously codedsignificant coefficients reside at positions to the right of a scan lineon which a current one of the significant coefficients resides. Inanother example, the scan has a horizontal pattern and the previouslycoded significant coefficients reside at positions below a scan line onwhich a current one of the significant coefficients resides. In anotherexample, the scan has a vertical pattern and the previously codedsignificant coefficients reside at positions to the right of a scan lineon which a current one of the significant coefficients resides.

The video coder may further be configured to code information indicatinglevels of the significant transform coefficients (148). The step ofcoding information indicating levels of the significant transformcoefficients may proceed in an inverse scan direction from higherfrequency coefficients in the block of transform coefficients to lowerfrequency coefficients in the block of transform coefficients. Like FIG.22, steps 142, 146 and 148 may be interleaved, as the determination ofcontexts for level information depends on the previously coded neighborcoefficients.

FIG. 27 is a flowchart illustrating an example process for significancemap and coefficient level scanning according to sub-sets of transformcoefficients. A method of coding transform coefficients associated withresidual video data in a video coding process is proposed. The methodmay be performed by a video coder, such as video encoder 20 or videodecoder 30 of FIG. 4. The video coder may be configured to arrange ablock of transform coefficients into one or more sub-sets of transformcoefficients (160), code significance of transform coefficients in eachsub-set (162), and code levels of transform coefficients in each sub-set(164). In one example, arranging the block of transform coefficients mayinclude arranging the block of transform coefficients into a single setof transform coefficients corresponding to an entire transform unit. Inanother example, arranging the block of transform coefficients mayinclude arranging the block of transform coefficients into one or moresub-sets of transform coefficients based on a scan order.

The video coder may be configured to code the significance of transformcoefficients in each sub-set according to a scan order, and code thelevels of transform coefficients according to the scan order. Coding thesignificance map (162) and the levels (164) may be performed together intwo or more consecutive scan passes on the sub-set (165).

FIG. 28 is a flowchart illustrating another example process forsignificance map and coefficient level scanning according to sub-sets oftransform coefficients. The video encoder may perform the consecutivescans (165) by first coding the significance of transform coefficientsin a sub-set in a first scan of transform coefficients in the respectivesub-set (170).

Coding of the coefficient levels (164) in each sub-set includes at leasta second scan of transform coefficients in the respective sub-set. Thesecond scan may include coding bin one of the levels of transformcoefficients in a sub-set in a second scan of transform coefficients inthe respective sub-set (172), coding remaining bins of the levels oftransform coefficients in a sub-set in a third scan of transformcoefficients in the respective sub-set (174), and coding a sign of thelevels of transform coefficients in a sub-set in a fourth scan oftransform coefficients in the respective sub-set (176).

FIG. 29 is a flowchart illustrating another example process forsignificance map and coefficient level scanning according to sub-sets oftransform coefficients. In this example, coding of the sign of thelevels of the transform coefficients (176) is performed before thecoding the levels (172, 174).

FIG. 30 is a flowchart illustrating an example process for entropycoding using multiple regions. A method of coding a plurality oftransform coefficients associated with residual video data in a videocoding process is proposed. The method may be performed by a videocoder, such as video encoder 20 or video decoder 30 of FIG. 4. The videocoder may be configured to code information indicating significantcoefficients for the plurality of transform coefficients according to ascan order (180), divide the coded information into a first region and asecond region (182), entropy code the coded information in the firstregion according to a first set of contexts using context adaptivebinary arithmetic coding (184), and entropy code the coded informationin the second region according to a second set of contexts using contextadaptive binary arithmetic coding (186). In one example, the scan orderhas an inverse direction and a diagonal scan pattern. This method mayalso be applied to more than two regions, wherein each region has a setof contexts.

The first and second regions may be divided in several ways. In oneexample, the first region contains at least the DC component of theplurality of transform coefficients, and the second region contains theremaining plurality of transform coefficients not in the first region.

In another example, the first region contains all transform coefficientswithin a region defined by x+y<T, where x is the horizontal position ofthe transform coefficient, y is the vertical position of the transformcoefficient, and T is a threshold. The first region may contain the DCcoefficient. The second region contains the remaining plurality oftransform coefficients not in the first region.

In another example, the first region contains all transform coefficientswithin a region defined by x<T and y<T, where x is the horizontalposition of the transform coefficient, y is the vertical position of thetransform coefficient, and T is a threshold. The second region containsthe remaining plurality of transform coefficients not in the firstregion.

In another example, the first region contains the DC coefficient, thesecond region contains all transform coefficients (excluding the DCcoefficient) within a region defined by x<T and y<T, where x is thehorizontal position of the transform coefficient, y is the verticalposition of the transform coefficient, and T is a threshold, and thethird regions contains the remaining plurality of transform coefficientsnot in the first region or the second region. In another example, thesecond and third regions described above may use the same method toderive contexts, but different context sets for each region are used.

In another example, the first region includes the DC component and thetransform coefficients at positions (1,0) and (0,1). The second regioncontains the remaining plurality of transform coefficients not in thefirst region.

In another example, the first region contains only the DC component ofthe plurality of transform coefficients, and the second region containsthe remaining plurality of transform coefficients.

In general, the first context for each transform coefficient in thefirst region is based on the position of each transform coefficient inthe first region, while the second context for each transformcoefficient in the second region is based on the coded information ofcausal neighbors of each transform coefficient. In some examples, thesecond context is further based on the position of each transformcoefficient in the second region. In another example, the second contextfor each transform coefficient in the second region is based on thecoded information of five causal neighbors of each transformcoefficient.

In one or more examples, the functions described in this disclosure maybe implemented in hardware, software, firmware, or any combinationthereof. If implemented in software, the functions may be performed by ahardware-based processing unit, such as one or more processors, thatexecute the software in the form of computer-readable instructions orcode. Such instructions or code may be stored on or transmitted over acomputer-readable medium and executed by a hardware-based processingunit. Computer-readable media may include computer-readable storagemedia, which corresponds to a tangible, non-transitory medium such asdata storage media, or communication media including any medium thatfacilitates transfer of a computer program from one place to another,e.g., according to a communication protocol. In this manner,computer-readable media generally may correspond to (1) tangiblecomputer-readable storage media which is non-transitory or (2) acommunication medium such as a signal or carrier wave. Data storagemedia may be any available media that can be accessed by one or morecomputers or one or more processors to retrieve instructions, codeand/or data structures for implementation of the techniques described inthis disclosure. A computer program product may include acomputer-readable medium.

By way of example, and not limitation, such computer-readable storagemedia can comprise RAM, ROM, EEPROM, Flash memory, CD-ROM or any othersolid state, optical or magnetic data storage media, including opticaldisk storage, magnetic disk storage, or other magnetic storage devices,or any other medium that can be used to store desired program code inthe form of instructions or data structures and that can be accessed bya computer. Also, any connection is properly termed a computer-readablemedium. For example, if instructions are transmitted from a website,server, or other remote source using a coaxial cable, fiber optic cable,twisted pair, digital subscriber line (DSL), or wireless technologiessuch as infrared, radio, and microwave, then the coaxial cable, fiberoptic cable, twisted pair, DSL, or wireless technologies such asinfrared, radio, and microwave are included in the definition of medium.It should be understood, however, that tangible computer-readablestorage media and data storage media do not include connections, carrierwaves, signals, or other transient media, but are instead directed tonon-transient, tangible storage media. Disk and disc, as used herein,includes compact disc (CD), laser disc, optical disc, digital versatiledisc (DVD), floppy disk and Blu-ray disc, where disks usually reproducedata magnetically, while discs reproduce data optically with lasers.Combinations of the above should also be included within the scope ofcomputer-readable media.

Instructions may be executed by one or more processors, such as one ormore digital signal processors (DSPs), general purpose microprocessors,application specific integrated circuits (ASICs), field programmablelogic arrays (FPGAs), or other equivalent integrated or discrete logiccircuitry. Accordingly, the term “processor,” as used herein may referto any of the foregoing structure or any other structure suitable forimplementation of the techniques described herein. In addition, in someaspects, the functionality described herein may be provided withindedicated hardware and/or software modules configured for encoding anddecoding, or incorporated in a combined codec. Also, the techniquescould be fully implemented in one or more circuits or logic elements.

The techniques of this disclosure may be performed by a wide variety ofdevices or apparatuses, including desktop computers, notebook (i.e.,laptop) computers, tablet computers, set-top boxes, telephone handsetssuch as so-called smartphones, televisions, cameras, display devices,digital media players, video gaming consoles, or the like. In manycases, such devices may be equipped for wireless communication. Inaddition, such techniques may be implemented by an integrated circuit(IC) or a set of ICs (e.g., a chip set). A device configured to performthe techniques of the this disclosure may include any of the devicesmentioned above and, in some cases, may be a video encoder or videodecoder, or combined video encoder-decoder, i.e., a video CODEC, whichmay be formed by a combination of hardware, software, and firmware.Various components, modules, or units may be described in thisdisclosure to emphasize functional aspects of devices configured toperform the disclosed techniques, but do not necessarily requirerealization by different hardware units. Rather, as described above,various units may be combined in a codec hardware unit or provided by acollection of interoperative hardware units, including one or moreprocessors as described above, in conjunction with suitable softwareand/or firmware.

Various examples have been described. These and other examples arewithin the scope of the following claims.

1. A method of coding a plurality of transform coefficients associatedwith residual video data in a video coding process, the methodcomprising: coding information indicating significant coefficients forthe plurality of transform coefficients according to a scan order; andcoding information indicating levels of the plurality transformcoefficients according to the scan order.
 2. The method of claim 1,wherein the video coding process uses context adaptive binary arithmeticcoding (CABAC).
 3. The method of claim 1, wherein the plurality oftransform coefficients are arranged in a block.
 4. The method of claim1, wherein the scan order comprises a scan direction, and wherein thescan direction is an inverse scan direction proceeding from higherfrequency coefficients in the plurality of transform coefficients tolower frequency coefficients in the plurality of transform coefficients.5. The method of claim 1, wherein the scan order comprises a scanpattern, and wherein the scan pattern comprises one of a sub-blockpattern, diagonal pattern, zig-zag pattern, horizontal pattern orvertical pattern.
 6. The method of claim 2, further comprising:determining contexts for coding the levels of the significantcoefficients for a plurality of sub-sets of the significantcoefficients, wherein each of the plurality of sub-sets comprises one ormore coefficients scanned according to the scan order.
 7. The method ofclaim 6, further comprising; deriving a first context for a first blockof the transform coefficients, the first block having a first size,according to context derivation criteria; and deriving a second contextfor a second block of the transform coefficients, the second blockhaving a second, different size, according to the same contextderivation criteria as the first block.
 8. The method of claim 6,further comprising deriving contexts for coding the levels ofsignificant coefficients of a plurality of blocks of video data, whereincontext derivation criteria used to derive the contexts is the same forall of the plurality of blocks of video data regardless of a size of aparticular block.
 9. The method of claim 6, further comprising selectingdifferent sets of contexts for different sub-sets of the coefficientsbased on whether the respective sub-sets contain a DC coefficient of thetransform coefficients.
 10. The method of claim 6, further comprisingselecting different sets of contexts for different sub-sets of thecoefficients based on a weighted number of significant coefficients inother preceding sub-sets of the coefficients.
 11. The method of claim 6,further comprising selecting different sets of contexts for differentsub-set of the coefficients based on a number of significantcoefficients in a current sub-set.
 12. The method of claim 6, furthercomprising selecting a unique set of contexts for a sub-set containing alast significant coefficient.
 13. A system configured to code aplurality of transform coefficients associated with residual video datain a video coding process, the system comprising: a video codingprocessor configured to code information indicating significantcoefficients for the plurality of transform coefficients according to ascan order, and further configured to code information indicating levelsof the significant coefficients for the plurality transform coefficientsaccording to the scan order.
 14. The system of claim 13, wherein thevideo coding processor uses context adaptive binary arithmetic coding(CABAC) to code the information indicating significant coefficients andto code the information indicating the levels of the significantcoefficients.
 15. The system of claim 13, wherein the plurality oftransform coefficients are arranged in a block.
 16. The system of claim13, wherein the scan order comprises a scan direction, and wherein thescan direction is an inverse scan direction proceeding from higherfrequency coefficients in the plurality of transform coefficients tolower frequency coefficients in the plurality of transform coefficients.17. The system of claim 13, wherein the scan order comprises a scanpattern, and wherein the scan pattern comprises one of a sub-blockpattern, diagonal pattern, zig-zag pattern, horizontal pattern orvertical pattern.
 18. The system of claim 14, wherein the video codingprocessor is further configured to determine contexts for coding thelevels of the significant coefficients for a plurality of sub-sets ofthe significant coefficients, wherein each of the plurality of sub-setscomprises one or more coefficients scanned according to the scan order.19. The system of claim 18, wherein the video coding processor isfurther configured to derive a first context for a first block of thetransform coefficients, the first block having a first size, accordingto context derivation criteria, and wherein the video coding unit isfurther configured to derive a second context for a second block of thetransform coefficients, the second block having a second, differentsize, according to the same context derivation criteria as the firstblock.
 20. The system of claim 18, wherein the video coding processor isfurther configured to derive contexts for coding the levels ofsignificant coefficients of a plurality of blocks of video data, whereincontext derivation criteria used to derive the contexts is the same forall of the plurality of blocks of video data regardless of a size of aparticular block.
 21. The system of claim 18, wherein the video codingprocessor is further configured to select different sets of contexts fordifferent sub-sets of the coefficients based on whether the respectivesub-sets contain a DC coefficient of the transform coefficients.
 22. Thesystem of claim 18, wherein the video coding processor is furtherconfigured to select different sets of contexts for different sub-setsof the coefficients based on a weighted number of significantcoefficients in other preceding sub-sets of the coefficients.
 23. Thesystem of claim 18, wherein the video coding processor is furtherconfigured to select different sets of contexts for different sub-set ofthe coefficients based on a number of significant coefficients in acurrent sub-set.
 24. The system of claim 18, wherein the video codingprocessor is further configured to select a unique set of contexts for asub-set containing a last significant coefficient.
 25. The system ofclaim 13, wherein the video coding processor is part of a video encoder.26. A system for coding a plurality of transform coefficients associatedwith residual video data in a video coding process, the systemcomprising: means for coding information indicating significantcoefficients for the plurality of transform coefficients according to ascan order; and means for coding information indicating levels of thesignificant coefficients for the plurality transform coefficientsaccording to the scan order.
 27. The system of claim 26, wherein eachmeans for coding uses context adaptive binary arithmetic coding (CABAC).28. The system of claim 26, wherein the plurality of transformcoefficients are arranged in a block.
 29. The system of claim 28,wherein the scan order comprises a scan direction, and wherein the scandirection is an inverse scan direction proceeding from higher frequencycoefficients in the plurality of transform coefficients to lowerfrequency coefficients in the plurality of transform coefficients. 30.The system of claim 28, wherein the scan order comprises a scan pattern,and wherein the scan pattern comprises one of a sub-block pattern,diagonal pattern, zig-zag pattern, horizontal pattern or verticalpattern.
 31. The system of claim 26, further comprising: means fordetermining contexts for coding the levels of the significantcoefficients for a plurality of sub-sets of the significantcoefficients, wherein each of the plurality of sub-sets comprises one ormore coefficients scanned according to the scan order.
 32. The system ofclaim 31, further comprising; means for deriving a first context for afirst block of the transform coefficients, the first block having afirst size, according to context derivation criteria; and means forderiving a second context for a second block of the transformcoefficients, the second block having a second, different size,according to the same context derivation criteria as the first block.33. The system of claim 31, further comprising means for derivingcontexts for coding the levels of significant coefficients of aplurality of blocks of video data, wherein context derivation criteriaused to derive the contexts is the same for all of the plurality ofblocks of video data regardless of a size of a particular block.
 34. Thesystem of claim 31, further comprising: means for selecting differentsets of contexts for different sub-sets of the coefficients based onwhether the respective sub-sets contain a DC coefficient of thetransform coefficients.
 35. The system of claim 31, further comprising:means for selecting different sets of contexts for different sub-sets ofthe coefficients based on a weighted number of significant coefficientsin other preceding sub-sets of the coefficients.
 36. The system of claim31, further comprising mean for selecting different sets of contexts fordifferent sub-set of the coefficients based on a number of significantcoefficients in a current sub-set.
 37. The system of claim 31, furthercomprising means for selecting a unique set of contexts for a sub-setcontaining a last significant coefficient.
 38. A computer programproduct comprising a computer-readable storage medium having storedthereon instructions that, when executed, cause a processor of a devicefor coding a plurality of transform coefficients associated withresidual video data in a video coding process to: code informationindicating significant coefficients for the plurality of transformcoefficients according to a scan order; and code information indicatinglevels of the significant coefficients for the plurality transformcoefficients according to the scan order.
 39. The computer programproduct of claim 38, wherein the instructions for coding use contextadaptive binary arithmetic coding (CABAC).
 40. The computer programproduct of claim 38, wherein the plurality of transform coefficients arearranged in a block.
 41. The computer program product of claim 40,wherein the scan order comprises a scan direction, and wherein the scandirection is an inverse scan direction proceeding from higher frequencycoefficients in the plurality of transform coefficients to lowerfrequency coefficients in the plurality of transform coefficients. 42.The computer program product of claim 40, wherein the scan ordercomprises a scan pattern, and wherein the scan pattern comprises one ofa sub-block pattern, diagonal pattern, zig-zag pattern, horizontalpattern or vertical pattern.
 43. The computer program product of claim38, further causing a processor to: determine contexts for coding thelevels of the significant coefficients for a plurality of sub-sets ofthe significant coefficients, wherein each of the plurality of sub-setscomprises one or more coefficients scanned according to the scan order.44. The computer program product of claim 43, further causing aprocessor to: derive a first context for a first block of the transformcoefficients, the first block having a first size, according to contextderivation criteria; and derive a second context for a second block ofthe transform coefficients, the second block having a second, differentsize, according to the same context derivation criteria as the firstblock.
 45. The computer program product of claim 43, further causing aprocessor to: derive contexts for coding the levels of significantcoefficients of a plurality of blocks of video data, wherein contextderivation criteria used to derive the contexts is the same for all ofthe plurality of blocks of video data regardless of a size of aparticular block.
 46. The computer program product of claim 43, furthercausing a processor to: select different sets of contexts for differentsub-sets of the coefficients based on whether the respective sub-setscontain a DC coefficient of the transform coefficients.
 47. The computerprogram product of claim 43, further causing a processor to: selectdifferent sets of contexts for different sub-sets of the coefficientsbased on a weighted number of significant coefficients in otherpreceding sub-sets of the coefficients.
 48. The computer program productof claim 43, further causing a processor to: select different sets ofcontexts for different sub-set of the coefficients based on a number ofsignificant coefficients in a current sub-set.
 49. The computer programproduct of claim 43, further causing a processor to: select a unique setof contexts for a sub-set containing a last significant coefficient.